|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
tporter Smarty n00b
Joined: 17 Jun 2014 Posts: 2
|
Posted: Tue Jun 17, 2014 6:59 pm Post subject: {insert} tags are deprecated from Smarty... |
|
|
Greetings,
I'm working on moving some old code which has a lot of the {insert ... } type of plugins (ad banner, rss feed, etc ...
I was looking at the docs to see what had changed and there is a notice on http://www.smarty.net/docs/en/language.function.insert.tpl, that says "{insert} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead."
I'm guessing the "PHP script" means use an include (haven't tried this yet)... I did try "plugin functions", since i could just move the code from the insert plugin to the function plugin... but the results cached so not the same as the original insert.
So I was trying to figure out if there was a plugin function that replaced the insert's ability - "{insert} tags work much like {include} tags, except that {insert} tags are NOT cached when template caching is enabled. They will be executed on every invocation of the template. "
I found the another reference to the insert plugin at http://www.smarty.net/docs/en/plugins.inserts.tpl, but there is no deprecated notice on that page... so is {insert ... } deprecated or not?
And what is the recommended way to replace it with to get the similar functionality ?
Thanks for your time.
Terre |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
tporter Smarty n00b
Joined: 17 Jun 2014 Posts: 2
|
Posted: Tue Jun 17, 2014 7:43 pm Post subject: |
|
|
It appears the {insert} is working without the SmartyBC class... (at least so far)
I was using the auto-register aka putting the plugin file in the plugin's dir. I will check out the register and its cache option, it looks promising.
Thanks ! |
|
Back to top |
|
|
|
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
|