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

fro smarty 2 to 3 using IF_FUNC

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
dave101ua
Smarty n00b


Joined: 23 Jan 2014
Posts: 4

PostPosted: Tue Nov 08, 2016 3:18 pm    Post subject: fro smarty 2 to 3 using IF_FUNC Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Nov 08, 2016 4:07 pm    Post subject: Reply with quote

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
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 -> Smarty 3 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