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

Recommended tutorials for Smarty 3

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


Joined: 09 Jun 2020
Posts: 6

PostPosted: Tue Jun 09, 2020 9:00 am    Post subject: Recommended tutorials for Smarty 3 Reply with quote

I've just started at a company that uses Smarty. I was wondering if there is a particular tutorial you would recommend for S3? Most of the ones in Google's results are quite old (v2) and I'm not sure if they would be good to follow.

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


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Tue Jun 09, 2020 6:59 pm    Post subject: Reply with quote

Documentation for Smarty 3 is quite complete.
If you have any specific usage questions, just ask them.
Back to top
View user's profile Send private message
n2fole00
Smarty Rookie


Joined: 09 Jun 2020
Posts: 6

PostPosted: Wed Jun 10, 2020 8:17 am    Post subject: Reply with quote

Edit: Sorry, I found what I was looking for here https://www.smarty.net/docs/en/language.modifiers.tpl

Ignore the rest.

AnrDaemon wrote:
Documentation for Smarty 3 is quite complete.
If you have any specific usage questions, just ask them.

Thanks. Actually, I have one. I was wondering where in the docs the info about the : (colon) is. For example I see
Code:
{if $controller|in_array:array('someController')}active{/if}
in my codebase. It's a neat shortcut to
Code:
in_array($current_item,$selected_array)
, but I would like to know a bit more about it and where else I can use it.

Thanks again Smile
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Thu Jun 11, 2020 4:40 pm    Post subject: Reply with quote

You can use it anywhere. Modifier syntax is quite transparent.

Say, I often use
Code:
{$var|print_r:1}
(which is a direct equivalent to "print_r($var, 1)" ) for quick-and-dirty template debugging.
Back to top
View user's profile Send private message
n2fole00
Smarty Rookie


Joined: 09 Jun 2020
Posts: 6

PostPosted: Thu Jun 11, 2020 7:09 pm    Post subject: Reply with quote

Thanks for the tip Smile
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