Skip to content

Commit 16dcf53

Browse files
committed
feature #4980 [#4974] Added Twig loader priority Documentation (wizhippo)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #4980). Discussion ---------- [#4974] Added Twig loader priority Documentation | Q | A | ------------- | --- | Doc fix? | no | New docs? | no (document extended feature) | Applies to | 2.7+ | Fixed tickets | #4974 Commits ------- 7d02f82 Added Twig loader priority Documentation
2 parents 89e626f + 7d02f82 commit 16dcf53

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

reference/dic_tags.rst

+8-3
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ the new loader and tag it with ``twig.loader``:
13371337
acme.demo_bundle.loader.some_twig_loader:
13381338
class: Acme\DemoBundle\Loader\SomeTwigLoader
13391339
tags:
1340-
- { name: twig.loader }
1340+
- { name: twig.loader, priority: 0 }
13411341
13421342
.. code-block:: xml
13431343
@@ -1351,7 +1351,7 @@ the new loader and tag it with ``twig.loader``:
13511351
id="acme.demo_bundle.loader.some_twig_loader"
13521352
class="Acme\DemoBundle\Loader\SomeTwigLoader">
13531353
1354-
<tag name="twig.loader" />
1354+
<tag name="twig.loader" priority="0" />
13551355
</service>
13561356
</services>
13571357
</container>
@@ -1360,9 +1360,14 @@ the new loader and tag it with ``twig.loader``:
13601360
13611361
$container
13621362
->register('acme.demo_bundle.loader.some_twig_loader', 'Acme\DemoBundle\Loader\SomeTwigLoader')
1363-
->addTag('twig.loader')
1363+
->addTag('twig.loader', array('priority' => 0))
13641364
;
13651365
1366+
.. note::
1367+
1368+
The ``priority`` value is optional and defaults to ``0``.
1369+
The higher priority loaders are tried first.
1370+
13661371
validator.constraint_validator
13671372
------------------------------
13681373

0 commit comments

Comments
 (0)