|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Flex42 Smarty n00b
Joined: 28 Jul 2010 Posts: 1
|
Posted: Wed Jul 28, 2010 9:06 am Post subject: Suggestion : better concatenate |
|
|
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'|...
|
|
Back to top |
|
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Sun Aug 08, 2010 3:47 pm Post subject: nice |
|
|
This sounds nice, but fits for modifiers only.
Several other kinds of plugins have &$smarty resource as one of the parameter.
But concatenating the variables at once would be better than using multiple |cat pipes.
Code: | {$var|cat:'a':'b':...} |
|
|
Back to top |
|
|
|
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
|