Skip to content

Commit

Permalink
feature #4556 Updated twig reference with optimizations and paths (jz…
Browse files Browse the repository at this point in the history
…awadzki)

This PR was merged into the 2.3 branch.

Discussion
----------

Updated twig reference with optimizations and paths

Added information about `optimizations` and `paths` twig configs to reference

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

Commits
-------

f89eb39 Updated twig reference with optimizations and paths
  • Loading branch information
weaverryan committed Feb 24, 2015
2 parents 1726054 + f89eb39 commit d447b12
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ TwigBundle Configuration ("twig")
strict_variables: ~
auto_reload: ~
optimizations: ~
paths:
"%kernel.root_dir%/../vendor/acme/foo-bar/templates": foo_bar
.. code-block:: xml
Expand All @@ -53,12 +55,14 @@ TwigBundle Configuration ("twig")
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/twig http://symfony.com/schema/dic/twig/twig-1.0.xsd">
<twig:config auto-reload="%kernel.debug%" autoescape="true" base-template-class="Twig_Template" cache="%kernel.cache_dir%/twig" charset="%kernel.charset%" debug="%kernel.debug%" strict-variables="false">
<twig:config auto-reload="%kernel.debug%" autoescape="true" base-template-class="Twig_Template" cache="%kernel.cache_dir%/twig" charset="%kernel.charset%" debug="%kernel.debug%" strict-variables="false" optimizations="true">
<twig:form>
<twig:resource>MyBundle::form.html.twig</twig:resource>
</twig:form>
<twig:global key="foo" id="bar" type="service" />
<twig:global key="pi">3.14</twig:global>
<twig:exception-controller>AcmeFooBundle:Exception:showException</twig:exception-controller>
<twig:path namespace="foo_bar">%kernel.root_dir%/../vendor/acme/foo-bar/templates</twig:path>
</twig:config>
</container>
Expand All @@ -74,13 +78,18 @@ TwigBundle Configuration ("twig")
'foo' => '@bar',
'pi' => 3.14,
),
'auto_reload' => '%kernel.debug%',
'autoescape' => true,
'base_template_class' => 'Twig_Template',
'cache' => '%kernel.cache_dir%/twig',
'charset' => '%kernel.charset%',
'debug' => '%kernel.debug%',
'strict_variables' => false,
'auto_reload' => '%kernel.debug%',
'autoescape' => true,
'base_template_class' => 'Twig_Template',
'cache' => '%kernel.cache_dir%/twig',
'charset' => '%kernel.charset%',
'debug' => '%kernel.debug%',
'strict_variables' => false,
'exception_controller' => 'AcmeFooBundle:Exception:showException',
'optimizations' => true,
'paths' => array(
'%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar',
),
));
Configuration
Expand Down

0 comments on commit d447b12

Please sign in to comment.