summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-06-22 00:25:24 +0000
committerChris McDonough <chrism@agendaless.com>2009-06-22 00:25:24 +0000
commite2062b4a1eb0afa179dbf25a29eda841eaccb86c (patch)
treed1115d0319fc2777ee1a76336979f3ecb2e68113 /docs
parent6ecdbc409d2109a9e7fc5367c64067f0400f07cc (diff)
downloadpyramid-e2062b4a1eb0afa179dbf25a29eda841eaccb86c.tar.gz
pyramid-e2062b4a1eb0afa179dbf25a29eda841eaccb86c.tar.bz2
pyramid-e2062b4a1eb0afa179dbf25a29eda841eaccb86c.zip
Add documentation for *subpath.
Switch back to using a route with a subpath in the bfgalchemy paster template.
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/hybrid.rst26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/narr/hybrid.rst b/docs/narr/hybrid.rst
index c3e61d906..73648a129 100644
--- a/docs/narr/hybrid.rst
+++ b/docs/narr/hybrid.rst
@@ -215,6 +215,32 @@ In this way, each route can use a different factory, making it
possible to traverse different graphs based on some routing parameter
within the same application.
+Using ``*subpath`` in a Route Path
+----------------------------------
+
+There are certain (extremely rare) cases when you'd like to influence
+the traversal :term:`subpath` when a route matches without atually
+performing traversal. For instance, the ``repoze.bfg.wsgi.wsgiapp2``
+decorator and the ``repoze.bfg.view.static`` helper attempt to compute
+``PATH_INFO`` from the request's subpath, so it's useful to be able to
+influence this value. When ``*subpath`` exists in a path pattern, no
+path is actually traversed, but the traversal algorithm will return a
+:term:`subpath` list implied by the capture value of ``*subpath``.
+You'll see this pattern most commonly in route declarations that look
+like this:
+
+.. code-block:: xml
+
+ <route
+ path="/static/*subpath"
+ name="static"
+ view=".views.static_view"
+ />
+
+Where ``.views.static_view`` is an instance of
+``repoze.bfg.view.static``. This effectively tells the static helper
+to traverse everything in the subpath as a filename.
+
Corner Cases
------------