diff options
Diffstat (limited to 'docs/tutorials/bfgwiki/basiclayout.rst')
| -rw-r--r-- | docs/tutorials/bfgwiki/basiclayout.rst | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/tutorials/bfgwiki/basiclayout.rst b/docs/tutorials/bfgwiki/basiclayout.rst index d57cd7134..5df7f2487 100644 --- a/docs/tutorials/bfgwiki/basiclayout.rst +++ b/docs/tutorials/bfgwiki/basiclayout.rst @@ -30,18 +30,28 @@ XML namespace. Our sample ZCML file looks like the following: #. *Line 4*. Boilerplate, the comment explains. -#. *Lines 6-9*. Register a ``<view>`` that is bound to a class. +#. *Lines 6-10*. Register a ``<view>`` that is ``for`` a class. ``.views.my_view`` is a *function* we write (generated by the ``bfg_zodb`` template) that is given a ``context`` and a - ``request`` and returns a response. + ``request`` and which returns a dictionary. The ``renderer`` tag + indicates that the ``templates/mytemplate.pt`` template should be + used to turn the dictionary returned by the view into a response. + ``templates/mytemplate.pt`` is a *relative* path: it names the + ``mytemplate.pt`` file which lives in the ``templates`` + subdirectory of the directory in which this ``configure.zcml`` + lives in. In this case, it means it lives in the ``tutorial`` + package's ``templates`` directory as ``mytemplate.pt`` Since this ``<view>`` doesn't have a ``name`` attribute, it is the "default" view for that class. -#. *Lines 11-15*. Register a ``static`` view which answers requests +#. *Lines 12-15*. Register a ``static`` view which answers requests which start with ``/static``. This is a view that will serve up static resources for us, in this case, at - ``http://localhost:6543/static/`` and below. + ``http://localhost:6543/static/`` and below. The ``path`` element + of this tag is a relative directory name, so it finds the resources + it should serve within the ``templates/static`` directory inside + the ``tutorial`` package. Content Models with ``models.py`` --------------------------------- |
