New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant use dump() function in twig files [oc3.0.2.0] #5933
Comments
Hi @jaynarayan89 i got this working changing the main file in
Cheers! |
@lipedeitos Thanks. |
OpenCart bullshit man what did you expect :/ |
And another childish comment. |
You can activate dump() function for twig environment by following these steps in opencart 3.0 :
|
RajeshThakur: - Thank you MAN!) |
Sadly neither of these methods appear to work in OpenCart 3.0.2.0 under PHP 5.6.33, 7.0.27 or 7.1.18. Is there an alternative way to dump template variables for debugging? Edit: Whoops! My fault. @RajeshThakur's solution works perfectly and I had a typo in my template. Be sure to use the correct syntax: {{ dump() }} |
@RajeshThakur 's solution working fine in following environment. OpenCart Version : 3.0.2.0 |
Thanks @RajeshThakur |
Thanks @RajeshThakur !! I test in OC 3.0.2 and perfect! after use {{ dump()}} i use the next code, to know all keys in the view: |
I am trying to find which variables are available to use in the template using dump() function of twig but it gives error of undefined function.
Then I search twig documentation and find out that it is disabled by default and we have to enable it but I think there is not any config option to turned on twig template debug in opencart 3.0.2.0.
when i dig the source code ,I found that twig is being initiated in catalog\controller\event\theme.php controller. I changed index method (just for testing)to activate debug mode but it didn't work.
I think there should be a option to enable or disable twig debuging.
The text was updated successfully, but these errors were encountered: