summaryrefslogtreecommitdiff
path: root/docs/tutorials/bfgwiki/basiclayout.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-10-10 01:03:53 +0000
committerChris McDonough <chrism@agendaless.com>2009-10-10 01:03:53 +0000
commit820508eb8200692cc8b1510caa19903d2af79c5a (patch)
tree3f562b5a07ceba4fee0dbb60ba9144417d2de8fa /docs/tutorials/bfgwiki/basiclayout.rst
parent9bbaa8a0be555560d8f1dad7bcf10bb64c500097 (diff)
downloadpyramid-820508eb8200692cc8b1510caa19903d2af79c5a.tar.gz
pyramid-820508eb8200692cc8b1510caa19903d2af79c5a.tar.bz2
pyramid-820508eb8200692cc8b1510caa19903d2af79c5a.zip
Convert bfgwiki to use renderers.
Diffstat (limited to 'docs/tutorials/bfgwiki/basiclayout.rst')
-rw-r--r--docs/tutorials/bfgwiki/basiclayout.rst18
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``
---------------------------------