Skip to content

Commit b71b007

Browse files
committed
Set twig service as private
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets |
1 parent 3774a37 commit b71b007

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cookbook/templating/twig_extension.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ Now you must let the Service Container know about your newly created Twig Extens
7474
services:
7575
app.twig_extension:
7676
class: AppBundle\Twig\AcmeExtension
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\AcmeExtension">
85+
<service id="app.twig_extension"
86+
class="AppBundle\Twig\AcmeExtension"
87+
public="false">
88+
8589
<tag name="twig.extension" />
8690
</service>
8791
</services>
@@ -93,6 +97,7 @@ Now you must let the Service Container know about your newly created Twig Extens
9397
9498
$container
9599
->register('app.twig_extension', '\AppBundle\Twig\AcmeExtension')
100+
->setPublic(false)
96101
->addTag('twig.extension');
97102
98103
.. note::

0 commit comments

Comments
 (0)