summaryrefslogtreecommitdiff
path: root/docs/narr/declarative.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-04 04:24:12 -0400
committerChris McDonough <chrism@plope.com>2010-11-04 04:24:12 -0400
commite19eaeb283dbfe6b64d963cafcc46837eaf1e76b (patch)
tree03f180c04f322bac689dbdcb92b4ea13894ef348 /docs/narr/declarative.rst
parentf8ed006738963a555f691b2dfdeae19aa5ef6b0f (diff)
downloadpyramid-e19eaeb283dbfe6b64d963cafcc46837eaf1e76b.tar.gz
pyramid-e19eaeb283dbfe6b64d963cafcc46837eaf1e76b.tar.bz2
pyramid-e19eaeb283dbfe6b64d963cafcc46837eaf1e76b.zip
de-zcml-ify events chapter
Diffstat (limited to 'docs/narr/declarative.rst')
-rw-r--r--docs/narr/declarative.rst26
1 files changed, 24 insertions, 2 deletions
diff --git a/docs/narr/declarative.rst b/docs/narr/declarative.rst
index 23ad63d2f..086b6aa51 100644
--- a/docs/narr/declarative.rst
+++ b/docs/narr/declarative.rst
@@ -1128,11 +1128,33 @@ You can add a custom locale negotiator via ZCML by using the
See also :ref:`custom_locale_negotiator` and
:ref:`localenegotiator_directive`.
+.. index::
+ pair: subscriber; ZCML directive
+
+.. _zcml_event_listener:
+
+Configuring an Event Listener via ZCML
+--------------------------------------
+
+You can configure an :term:`subscriber` by modifying your application's
+``configure.zcml``. Here's an example of a bit of XML you can add to the
+``configure.zcml`` file which registers the above ``mysubscriber`` function,
+which we assume lives in a ``subscribers.py`` module within your application:
+
+.. code-block:: xml
+ :linenos:
+
+ <subscriber
+ for="pyramid.interfaces.INewRequest"
+ handler=".subscribers.mysubscriber"
+ />
+
+See also :ref:`subscriber_directive` and :ref:`events_chapter`.
+
+
.. Todo
.. ----
-.. - events chapter still has topics for ZCML
-
.. - hooks chapter still has topics for ZCML
.. - resources chapter still has topics for ZCML