Post by adqa » Fri Sep 08, 2017 7:13 pm

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.

Image


Newbie

Posts

Joined
Fri May 21, 2010 6:45 pm

Post by grgr » Fri Sep 08, 2017 10:01 pm

That is correct.

Perhaps there is something wrong with the variable you are setting.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by DigitCart » Sat Sep 09, 2017 12:52 am

Hi,
Have you cleared the cache?

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by Johnathan » Sat Sep 09, 2017 3:30 am

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.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by adqa » Tue Sep 12, 2017 4:36 pm

Hi! Thank you for your responses.

Finally working. I had to delete cache, refresh modifications and refresh theme editor. Lot of steps to make a little change :-\

Image


Newbie

Posts

Joined
Fri May 21, 2010 6:45 pm
Who is online

Users browsing this forum: JessiesBoutique and 516 guests