summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-22 11:02:28 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-22 11:02:28 +0000
commit8392d7094c96f777f6d1d5f0c62051702191d106 (patch)
tree6fd39e2c10fc33a5b2be08e7467c9e6ad0887b78 /docs/api
parentb584143b2c408b979c340939f48b8a4ffe725e62 (diff)
downloadpyramid-8392d7094c96f777f6d1d5f0c62051702191d106.tar.gz
pyramid-8392d7094c96f777f6d1d5f0c62051702191d106.tar.bz2
pyramid-8392d7094c96f777f6d1d5f0c62051702191d106.zip
Add url-based dispatch.
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/urldispatch.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/api/urldispatch.rst b/docs/api/urldispatch.rst
new file mode 100644
index 000000000..81b28cebb
--- /dev/null
+++ b/docs/api/urldispatch.rst
@@ -0,0 +1,30 @@
+.. _urldispatch_module:
+
+:mod:`repoze.bfg.urldispatch`
+=============================
+
+.. automodule:: repoze.bfg.urldispatch
+
+ .. autoclass:: RoutesMapper
+ :members:
+
+You can configure the ``RoutesModelTraverser`` into your application's
+configure.zcml like so::
+
+ <adapter
+ factory="repoze.bfg.urldispatch.RoutesModelTraverser"
+ provides=".interfaces.ITraverserFactory"
+ for="repoze.bfg.interfaces.IURLDispatchModel repoze.bfg.interfaces.IRequest"
+ />
+
+An example of configuring a view that is willing to handle this sort
+of dispatch::
+
+ <bfg:view
+ for="repoze.bfg.interfaces.IURLDispatchModel"
+ view=".views.url_dispatch_view"
+ name="url_dispatch_controller"
+ />
+
+This view will be called with its context as a model with attributes
+matching the Routes routing dictionary associated with the request.