Hi! I'm trying to print a variable in view mode. I remember in older OCs the way was:
Controller: $data['field'] = "some value";
View: <p>$field</p>
And that's it. But in OC 3
Controller: $data['field'] = "some value";
View: <p>{{field}}</p>
not working... Any help? Thank you in advance.
That is correct.
Perhaps there is something wrong with the variable you are setting.
Perhaps there is something wrong with the variable you are setting.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
DigitCart is probably right: Twig has caching, and you're probably seeing a cached version of the page. You can turn caching off in OpenCart 3 by clicking the gear icon in the upper-right of the admin panel dashboard. Turn off both types of caching in there, and refresh both of them, and it should then show your edits properly.
Who is online
Users browsing this forum: JessiesBoutique and 516 guests