@@ -1152,9 +1152,13 @@ in a JavaScript string, use the ``js`` context:
1152
1152
Debugging
1153
1153
---------
1154
1154
1155
- When using PHP and the templating engine you can use ``var_dump() `` if you
1156
- need to quickly find the value of a variable passed to the template. The
1157
- same can be achieved when using Twig by using the debug extension. This
1155
+ .. versionadded :: 2.0.9
1156
+ This feature is available as of Twig ``1.5.x ``, which was first shipped
1157
+ with Symfony 2.0.9.
1158
+
1159
+ When using PHP, you can use ``var_dump() `` if you need to quickly find the
1160
+ value of a variable passed. This is useful, for example, inside your controller.
1161
+ The same can be achieved when using Twig by using the debug extension. This
1158
1162
needs to be enabled in the config:
1159
1163
1160
1164
.. configuration-block ::
@@ -1186,7 +1190,6 @@ needs to be enabled in the config:
1186
1190
$definition->addTag('twig.extension');
1187
1191
$container->setDefinition('acme_hello.twig.extension.debug', $definition);
1188
1192
1189
-
1190
1193
Template parameters can then be dumped using the ``dump `` function:
1191
1194
1192
1195
.. code-block :: html+jinja
@@ -1202,9 +1205,9 @@ Template parameters can then be dumped using the ``dump`` function:
1202
1205
{% endfor %}
1203
1206
1204
1207
1205
- The variables will only be dumped if Twig's debug setting is set to true.
1206
- By default this means that the variables will be dumped in the `` dev `` environment
1207
- but not the ``prod `` environment.
1208
+ The variables will only be dumped if Twig's `` debug `` setting (in `` config.yml ``)
1209
+ is `` true ``. By default this means that the variables will be dumped in the
1210
+ `` dev `` environment but not the ``prod `` environment.
1208
1211
1209
1212
Template Formats
1210
1213
----------------
0 commit comments