Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

How to mutate smarty variable before it is rendered ?

 
Post new topic   Reply to topic    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: 1572

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:   
Post new topic   Reply to topic    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