From 13c923f6eaf56a49897af75e14c1f70d1b26c75b Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 24 Nov 2009 20:49:16 +0000 Subject: Docs updates. --- docs/narr/views.rst | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'docs/narr/views.rst') diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 2e574cb14..566ef765a 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -574,10 +574,34 @@ acts as a :mod:`repoze.bfg` view. All ZCML attributes (save for the the same thing. To make :mod:`repoze.bfg` process your ``@bfg_view`` declarations, you -*must* insert the following boilerplate into your application's -``configure.zcml``:: +*must* do one of the following: - +- If you are using :term:`ZCML`, insert the following boilerplate into + your application's ``configure.zcml``: + + .. code-block:: xml + :linenos: + + + +- If you are using :term:`imperative configuration`, use the ``scan`` + method of the ``Configurator`` object: + + .. code-block:: python + :linenos: + + config.scan() + +.. note:: See :ref:`configuration_module` for additional API arguments + to the ``Configurator.scan`` method. For example, the ``scan`` + method allows you to supply a ``package`` argument to better + control exactly *which* code will be scanned. This is the same + value implied by the ``package`` attribute of the ZCML ```` + directive. + +Please see :ref:`scanning_chapter` for more information about what +happens when code is scanned for configuration declarations resulting +from use of decorators like ``@bfg_view``. After you do so, you will not need to use any other ZCML to configure :mod:`repoze.bfg` view declarations. Instead, you will be able to use -- cgit v1.2.3