From 60bfb44d6b8e17c750406c884848c0f7b38181d5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 16 Nov 2008 00:15:18 +0000 Subject: Describe registration. --- docs/narr/events.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'docs/narr/events.rst') diff --git a/docs/narr/events.rst b/docs/narr/events.rst index 6bdbb59f4..c6242c25d 100644 --- a/docs/narr/events.rst +++ b/docs/narr/events.rst @@ -134,23 +134,30 @@ object provided by the event. Here's an example. if 'application/json' in accept: alsoProvides(request, IJSONRequest) -Then in your view registration ZCML, you can use the ``request_type`` -attribute to point at different view functions depending upon the -interface implemented by the request. For example, if the above -subscriber function was registered, the three view registrations below -could be used to point at separate view functions using separate -request type interfaces for the same model object. +Then in your view registration ZCML, if you subscribe +``categorize_request`` for the ``repoze.bfg.interfaces.INewRequest`` +type, you can use the ``request_type`` attribute to point at different +view functions depending upon the interface implemented by the +request. For example, if the above subscriber function was +registered, the three view registrations below could be used to point +at separate view functions using separate request type interfaces for +the same model object. .. code-block:: xml :linenos: - + + + - +