Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

How to mutate smarty variable before it is rendered ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
robb
Smarty n00b


Joined: 26 Dec 2018
Posts: 1

PostPosted: Wed Dec 26, 2018 2:01 pm    Post subject: How to mutate smarty variable before it is rendered ? Reply with quote

Maybe you fine folks can help me here.

I'm working on a prestashop module and I would like to incorporate some "shortcode" functionality, unfortunately prestashop doesn't offer any good hooks for this stuff or callback functions before the content is echo'ed on the page. I was hoping smarty could help me out here.

I found something like registerFilter() that could be what I need but it doesn't seem to work at all, it does this weird thing where it outputs the actual smarty syntax when I clear the cache the first time, but then it just doesn't do anything, its ignoring my filter completely.

Has anyone got anything like this done? Or its simply something that smarty doesn't support yet? Thanks y'all. Very Happy
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Dec 27, 2018 10:36 am    Post subject: Reply with quote

Filters are intended for template rewriting, before they are compiled.
I would suggest reading the domcumentation, with examples, more carefully.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP