Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.1frombamarni:patch-7
May 26, 2013
Merged
Changes fromall 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 deletionsbook/templating.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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
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

[8]ページ先頭

©2009-2025 Movatter.jp