From 579fa16e548baf177cc0e2542df85e5c5598c287 Mon Sep 17 00:00:00 2001 From: Christian Morgan Date: Thu, 21 Mar 2013 13:57:37 +0000 Subject: [PATCH] Reordered two code blocks so that YML appears before XML, to match style used everywhere else in the docs except for translations (where XLIFF is the recommended format). Minor typos and readability edits in wording around these blocks --- cookbook/request/mime_type.rst | 22 +++++++++++----------- cookbook/templating/twig_extension.rst | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cookbook/request/mime_type.rst b/cookbook/request/mime_type.rst index 3e2fbe640ac..29ac6f484d9 100644 --- a/cookbook/request/mime_type.rst +++ b/cookbook/request/mime_type.rst @@ -43,11 +43,20 @@ project:: Registering your Listener ------------------------- -As for any other listener, you need to add it in one of your configuration -file and register it as a listener by adding the ``kernel.event_listener`` tag: +As with any other listener, you need to add it in one of your configuration +files and register it as a listener by adding the ``kernel.event_listener`` tag: .. configuration-block:: + .. code-block:: yaml + + # app/config/config.yml + services: + acme.demobundle.listener.request: + class: Acme\DemoBundle\RequestListener + tags: + - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } + .. code-block:: xml @@ -63,15 +72,6 @@ file and register it as a listener by adding the ``kernel.event_listener`` tag: - .. code-block:: yaml - - # app/config/config.yml - services: - acme.demobundle.listener.request: - class: Acme\DemoBundle\RequestListener - tags: - - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } - .. code-block:: php # app/config/config.php diff --git a/cookbook/templating/twig_extension.rst b/cookbook/templating/twig_extension.rst index 8bb744941cd..37a2c67d723 100644 --- a/cookbook/templating/twig_extension.rst +++ b/cookbook/templating/twig_extension.rst @@ -56,19 +56,10 @@ As an example you'll create a price filter to format a given number into price:: Register an Extension as a Service ---------------------------------- -Now you must let Service Container know about your newly created Twig Extension: +Now you must let the Service Container know about your newly created Twig Extension: .. configuration-block:: - .. code-block:: xml - - - - - - - - .. code-block:: yaml # src/Acme/DemoBundle/Resources/config/services.yml @@ -78,6 +69,15 @@ Now you must let Service Container know about your newly created Twig Extension: tags: - { name: twig.extension } + .. code-block:: xml + + + + + + + + .. code-block:: php // src/Acme/DemoBundle/Resources/config/services.php