joomla-twig icon indicating copy to clipboard operation
joomla-twig copied to clipboard

Add information about debug

Open phproberto opened this issue 7 years ago • 0 comments

User reported this:

I wanted to give you some feedback on something I found when first trying to use Joomla-twig.
On the main github page under Installation it says you can do this to view an example:

JLoader::import('twig.library');
echo Twig::render('@library/twig/examples.html.twig');

When I tried this I received an error because dump() couldn’t be found. I had to use this code to get the example to work:

JLoader::import('twig.library');
$twig = Twig::instance();
$twig->environment()->addExtension(new Twig_Extension_Debug());
$twig->environment()->enableDebug();
echo Twig::render('@library/twig/layouts/examples.html.twig');

After I had that working I had a lot more confidence in using your project.

Add information about how to use debug and how it works in default mode.

joomla-twig-debug-auto

phproberto avatar Nov 21 '18 09:11 phproberto