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

Difference between inline php function or a php modifier

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
pedrotester
Smarty Rookie


Joined: 06 Jun 2019
Posts: 33

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: 1615

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 Rookie


Joined: 06 Jun 2019
Posts: 33

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:   
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