File tree 1 file changed +1
-35
lines changed
1 file changed +1
-35
lines changed Original file line number Diff line number Diff line change @@ -1340,43 +1340,9 @@ in a JavaScript string, use the ``js`` context:
1340
1340
Debugging
1341
1341
---------
1342
1342
1343
- .. versionadded :: 2.0.9
1344
- This feature is available as of Twig ``1.5.x ``, which was first shipped
1345
- with Symfony 2.0.9.
1346
-
1347
1343
When using PHP, you can use ``var_dump() `` if you need to quickly find the
1348
1344
value of a variable passed. This is useful, for example, inside your controller.
1349
- The same can be achieved when using Twig by using the debug extension. This
1350
- needs to be enabled in the config:
1351
-
1352
- .. configuration-block ::
1353
-
1354
- .. code-block :: yaml
1355
-
1356
- # app/config/config.yml
1357
- services :
1358
- acme_hello.twig.extension.debug :
1359
- class : Twig_Extension_Debug
1360
- tags :
1361
- - { name: 'twig.extension' }
1362
-
1363
- .. code-block :: xml
1364
-
1365
- <!-- app/config/config.xml -->
1366
- <services >
1367
- <service id =" acme_hello.twig.extension.debug" class =" Twig_Extension_Debug" >
1368
- <tag name =" twig.extension" />
1369
- </service >
1370
- </services >
1371
-
1372
- .. code-block :: php
1373
-
1374
- // app/config/config.php
1375
- use Symfony\Component\DependencyInjection\Definition;
1376
-
1377
- $definition = new Definition('Twig_Extension_Debug');
1378
- $definition->addTag('twig.extension');
1379
- $container->setDefinition('acme_hello.twig.extension.debug', $definition);
1345
+ The same can be achieved when using Twig thanks to the the debug extension.
1380
1346
1381
1347
Template parameters can then be dumped using the ``dump `` function:
1382
1348
You can’t perform that action at this time.
0 commit comments