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

Suggestion : better concatenate

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
Flex42
Smarty n00b


Joined: 28 Jul 2010
Posts: 1

PostPosted: Wed Jul 28, 2010 9:06 am    Post subject: Suggestion : better concatenate Reply with quote

Hi all,

Why not improve a little bit the 'cat' modifier ?

I would suggest somthing like this :
Code:

function cat() {
   $res = '';
   $args = func_get_args();
   foreach($args as $arg){
      $res .= $arg;
   }
   return $res;
}


As this can take an arbitrary number of parameters, you won't have to do things like this : ...|cat:'a'|cat:'b'|...

Smile
Back to top
View user's profile Send private message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Sun Aug 08, 2010 3:47 pm    Post subject: nice Reply with quote

This sounds nice, but fits for modifiers only.
Several other kinds of plugins have &$smarty resource as one of the parameter. Sad

But concatenating the variables at once would be better than using multiple |cat pipes.

Code:
{$var|cat:'a':'b':...}
Back to top
View user's profile Send private message Visit poster's website
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 -> Feature Requests 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