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

Help for newbie

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


Joined: 12 Nov 2012
Posts: 1

PostPosted: Mon Nov 12, 2012 3:04 pm    Post subject: Help for newbie Reply with quote

Hello guys,

I begin to working with PIWIK. This service can of develop plugin with SMARTY.

In a Exemple's plugin, I find this command :

Code:
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}


I don't understand. Someone can explain me, what do it means ?

thanks for your help
Back to top
View user's profile Send private message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 541

PostPosted: Mon Nov 12, 2012 3:13 pm    Post subject: Re: Help for newbie Reply with quote

djik wrote:
Hello guys,

I begin to working with PIWIK. This service can of develop plugin with SMARTY.

In a Exemple's plugin, I find this command :

Code:
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}


I don't understand. Someone can explain me, what do it means ?

thanks for your help


truncate is a modifier:

http://www.smarty.net/docs/en/language.modifier.truncate.tpl

The first parameter after the : indicates how many chars to truncate to.

the backticks ` indicate that the expression $fooTruncCount/$barTruncFactor-1
will be evaluated, so, $foo will be truncated to $fooTruncCount/$barTruncFactor-1 characters
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 Development 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