Post by sitoryu » Wed Jun 06, 2018 4:46 pm

Hello eveyone,
I tried to parse array, for example print_r or var_dump (category array).

{{ category.name }}
I wnat to see what exist in category.

Unsuccessful - can you please help me and write example how to print array int code?
Tnx

Newbie

Posts

Joined
Wed Jun 06, 2018 4:43 pm

Post by Johnathan » Wed Jun 06, 2018 9:43 pm

You can find Twig syntax documentation here:

https://twig.symfony.com/doc/2.x/functions/dump.html

Image
Image Image Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by sitoryu » Thu Jun 07, 2018 1:38 am

Sorry for question, I am don't know Syphony -> where exactly I need add this method?
"You must add the Twig_Extension_Debug extension explicitly when creating your Twig environment:"
Tnx

Newbie

Posts

Joined
Wed Jun 06, 2018 4:43 pm

Post by sitoryu » Thu Jun 07, 2018 2:00 am

I find - if some one need, below instraction how to do it:

You can activate dump() function for twig environment by following these steps in opencart 3.0 :

Go to system/library/template/Twig/Environment.php
Here in constructor function you can find $options array. Set 'debug' option to 'true'.
Now we need to include debug extension, so
add $this->addExtension(new Twig_Extension_Debug()); below.
That's all we need to do. Now test if its working for you and update here.

Newbie

Posts

Joined
Wed Jun 06, 2018 4:43 pm
Who is online

Users browsing this forum: No registered users and 4 guests