Skip to content

Commit

Permalink
minor #4908 Set twig service as private (ifdattic)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Set twig service as private

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

b71b007 Set twig service as private
  • Loading branch information
weaverryan committed Jan 30, 2015
2 parents 37fd035 + b71b007 commit bd279f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cookbook/templating/twig_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ Now you must let the Service Container know about your newly created Twig Extens
services:
app.twig_extension:
class: AppBundle\Twig\AppExtension
public: false
tags:
- { name: twig.extension }
.. code-block:: xml
<!-- app/config/services.xml -->
<services>
<service id="app.twig_extension" class="AppBundle\Twig\AppExtension">
<service id="app.twig_extension"
class="AppBundle\Twig\AppExtension"
public="false">
<tag name="twig.extension" />
</service>
</services>
Expand All @@ -93,6 +96,7 @@ Now you must let the Service Container know about your newly created Twig Extens
$container
->register('app.twig_extension', '\AppBundle\Twig\AppExtension')
->setPublic(false)
->addTag('twig.extension');
.. note::
Expand Down

0 comments on commit bd279f6

Please sign in to comment.