summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/api/url.rst2
-rw-r--r--docs/narr/urldispatch.rst16
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
---------------------------