Cant use dump() function in twig files or how to enable debug in opencart twig or print_r alternate use dump() in opencart 3.0

if you are facing the following problem.

Cant use dump() function in twig files

 or 

how to enable debug in opencart twig

 or

 print_r alternate use dump() in opencart 3.0


for fixing this problem follow these steps

You can activate dump() function for twig environment by following these steps in opencart 3.0 :
  1. Go to system/library/template/Twig/Environment.php
  2. Here in the constructor function, you can find $options array. Set 'debug' option to 'true'.
  3. Now we need to include debug extension, so
  4. add $this->addExtension(new Twig_Extension_Debug()); below.
  5. Now you can use {{ dump(your_variable_name) }} as print_r variable in php
That's all 😅😆😛

Popular posts from this blog

How to open cPanel using WHM access.