8000 [Twig] removed unneeded configuration by bamarni · Pull Request #2641 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Twig] removed unneeded configuration #2641

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

Merged
merged 1 commit into from
May 26, 2013
Merged
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
36 changes: 1 addition & 35 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1340,43 +1340,9 @@ in a JavaScript string, use the ``js`` context:
Debugging
---------

.. versionadded:: 2.0.9
This feature is available as of Twig ``1.5.x``, which was first shipped
with Symfony 2.0.9.

When using PHP, you can use ``var_dump()`` if you need to quickly find the
9043 value of a variable passed. This is useful, for example, inside your controller.
The same can be achieved when using Twig by using the debug extension. This
needs to be enabled in the config:

.. configuration-block::

.. code-block:: yaml

# app/config/config.yml
services:
acme_hello.twig.extension.debug:
class: Twig_Extension_Debug
tags:
- { name: 'twig.extension' }

.. code-block:: xml

<!-- app/config/config.xml -->
<services>
<service id="acme_hello.twig.extension.debug" class="Twig_Extension_Debug">
<tag name="twig.extension" />
</service>
</services>

.. code-block:: php

// app/config/config.php
use Symfony\Component\DependencyInjection\Definition;

$definition = new Definition('Twig_Extension_Debug');
$definition->addTag('twig.extension');
$container->setDefinition('acme_hello.twig.extension.debug', $definition);
The same can be achieved when using Twig thanks to the the debug extension.

Template parameters can then be dumped using the ``dump`` function:

Expand Down
0