![Smarty Forum Index Smarty Forum Index](templates/smarty/images/phpbb2_logo.gif) |
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 |
dave101ua Smarty n00b
Joined: 23 Jan 2014 Posts: 4
|
Posted: Tue Nov 08, 2016 3:18 pm Post subject: fro smarty 2 to 3 using IF_FUNC |
|
|
Hello
I'm going to upgrade from smarty 2 to 3
in smarty 2 I use such trick:
Code: | $smarty->security_settings['IF_FUNCS'][] = "isFreeStyle"; |
this makes isFreeStyle function available inside if statements in templates:
Code: | {if isFreeStyle()}freestyle{else} no{/if} |
how can I do that in smarty 3 ? is such trick available ? if no then what I can do here ?
oh man, seems that they ara available already without any tricks....
UPD. yes, no tricks needed. Question is solved
Thanks |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Nov 08, 2016 4:07 pm Post subject: |
|
|
Yes, you can use most of any PHP functions (and PHP code overall) within smarty tags.
However, please use your best judgement about the scope of application of such techniques. Convoluted constructions within template do not add to readability. |
|
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
|