diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-06-24 04:04:06 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-06-24 04:04:06 +0000 |
| commit | dc405b2e9bac8e43350442a7824901f5ced8e3d5 (patch) | |
| tree | 9848b737b83471905ad95df6e34c12f568398c53 /docs | |
| parent | affef3124f49441989522a5c87589d37a9b8585a (diff) | |
| download | pyramid-dc405b2e9bac8e43350442a7824901f5ced8e3d5.tar.gz pyramid-dc405b2e9bac8e43350442a7824901f5ced8e3d5.tar.bz2 pyramid-dc405b2e9bac8e43350442a7824901f5ced8e3d5.zip | |
- Added the ``repoze.bfg.url.route_url`` API. This is meant to
"front" for the Routes ``url_for`` API. See the URL Dispatch
narrative chapter and the "repoze.bfg.url" module API documentation
for more information.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api/url.rst | 2 | ||||
| -rw-r--r-- | docs/narr/urldispatch.rst | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/api/url.rst b/docs/api/url.rst index d984dcc07..36d3c5b65 100644 --- a/docs/api/url.rst +++ b/docs/api/url.rst @@ -7,5 +7,7 @@ .. autofunction:: model_url + .. autofunction:: route_url + .. autofunction:: urlencode diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index f62a682c9..dab026455 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -388,6 +388,22 @@ declaration: view=".views.root_view" /> +Generating Route URLs +--------------------- + +Use the :mod:`repoze.bfg.url.route_url` function to generate URLs +based on route paths. For example, if you've configured a route in +ZCML with the ``name`` "foo" and the ``path`` ":a/:b/:c", you might do +this. + +.. code-block:: python + + from repoze.bfg.url import route_url + url = route_url('foo', a='1', b='2', c='3') + +This would return something like the string +``http://example.com/1/2/3``. + Cleaning Up After a Request --------------------------- |
