Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4974] Added Twig loader priority Documentation #4980

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ the new loader and tag it with ``twig.loader``:
acme.demo_bundle.loader.some_twig_loader:
class: Acme\DemoBundle\Loader\SomeTwigLoader
tags:
- { name: twig.loader }
- { name: twig.loader, priority: 0 }

.. code-block:: xml

Expand All @@ -1351,7 +1351,7 @@ the new loader and tag it with ``twig.loader``:
id="acme.demo_bundle.loader.some_twig_loader"
class="Acme\DemoBundle\Loader\SomeTwigLoader">

<tag name="twig.loader" />
<tag name="twig.loader" priority="0" />
</service>
</services>
</container>
Expand All @@ -1360,9 +1360,14 @@ the new loader and tag it with ``twig.loader``:

$container
->register('acme.demo_bundle.loader.some_twig_loader', 'Acme\DemoBundle\Loader\SomeTwigLoader')
->addTag('twig.loader')
->addTag('twig.loader', array('priority' => 0))
;

.. note::

The ``priority`` value is optional and defaults to ``0``.
The higher priority loaders are tried first.

validator.constraint_validator
------------------------------

Expand Down