From dc405b2e9bac8e43350442a7824901f5ced8e3d5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 24 Jun 2009 04:04:06 +0000 Subject: - 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. --- docs/api/url.rst | 2 ++ docs/narr/urldispatch.rst | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'docs') 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 --------------------------- -- cgit v1.2.3