diff options
Diffstat (limited to 'docs/tutorials/bfgwiki2/basiclayout.rst')
| -rw-r--r-- | docs/tutorials/bfgwiki2/basiclayout.rst | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/tutorials/bfgwiki2/basiclayout.rst b/docs/tutorials/bfgwiki2/basiclayout.rst index 98e8bb183..303622c7e 100644 --- a/docs/tutorials/bfgwiki2/basiclayout.rst +++ b/docs/tutorials/bfgwiki2/basiclayout.rst @@ -32,16 +32,24 @@ XML namespace. Our sample ZCML file looks like the following: SQLAlchemy connection after a request is finished. #. *Lines 9-12*. Register a ``<route>`` that will be used when the - URL is ``/``. Since this ``<view>`` has a blank ``name`` - attribute, it is the "default" view. ``.views.my_view`` refers to a + URL is ``/``. Since this ``<route>`` has an empty ``path`` + attribute, it is the "default" route. The attribute named ``view`` + with the value ``.views.my_view`` is the dotted name to a *function* we write (generated by the ``bfg_routesalchemy`` template) that is given a ``context`` and a ``request`` and returns - a response. - -#. *Lines 14-17*. Register a ``<route>`` with a path that starts with - ``/static``, capturing the rest of the URL as ``subpath``. This is - a view that will serve up static resources for us, in this case, at - ``http://localhost:6543/static/`` and below. + a response. You will use mostly ``<route>`` statements in a + :term:`URL dispatch` based application to map URLs to code. + +#. *Lines 14-17*. Register a ``<view>`` with a path that starts with + ``/static``. This points at a bit of code (``.views.static_view``) + that will serve up static resources for us, in this case, at + ``http://localhost:6543/static/`` and below. ``<view>`` + declarations also map code to URLs like ``route`` statements, + except they match URLs based on :term:`traversal`. With this view + declaration, we're saying that any URL that starts with ``/static`` + should go to the static view; any remainder of its path (e.g. the + ``/foo`` in ``/static/foo``) will be used to compose a path to a + static file resource (CSS and such). Content Models with ``models.py`` --------------------------------- |
