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

Difference between inline php function or a php modifier

 
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
pedrotester
Smarty Regular


Joined: 06 Jun 2019
Posts: 40

PostPosted: Mon Dec 16, 2019 5:56 pm    Post subject: Difference between inline php function or a php modifier Reply with quote

Example:

Code:
{if is_file($var)}

vs

Code:
{if $var|is_file}


Is one better than the other? why?

ty
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Dec 18, 2019 7:01 am    Post subject: Reply with quote

Neither is better, the filter syntax is intended for cases where you want to actually output the result.
Back to top
View user's profile Send private message
pedrotester
Smarty Regular


Joined: 06 Jun 2019
Posts: 40

PostPosted: Wed Dec 18, 2019 8:09 pm    Post subject: Reply with quote

ok so i will use the function method in a if, and the filter method for variables

thank you
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