Skip to content

Commit bd279f6

Browse files
committed
minor #4908 Set twig service as private (ifdattic)
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
2 parents 37fd035 + b71b007 commit bd279f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: cookbook/templating/twig_extension.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,17 @@ Now you must let the Service Container know about your newly created Twig Extens
7474
services:
7575
app.twig_extension:
7676
class: AppBundle\Twig\AppExtension
77+
public: false
7778
tags:
7879
- { name: twig.extension }
7980
8081
.. code-block:: xml
8182
8283
<!-- app/config/services.xml -->
8384
<services>
84-
<service id="app.twig_extension" class="AppBundle\Twig\AppExtension">
85+
<service id="app.twig_extension"
86+
class="AppBundle\Twig\AppExtension"
87+
public="false">
8588
<tag name="twig.extension" />
8689
</service>
8790
</services>
@@ -93,6 +96,7 @@ Now you must let the Service Container know about your newly created Twig Extens
9396
9497
$container
9598
->register('app.twig_extension', '\AppBundle\Twig\AppExtension')
99+
->setPublic(false)
96100
->addTag('twig.extension');
97101
98102
.. note::

0 commit comments

Comments
 (0)