|
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 |
sandeepshinde Smarty Rookie
Joined: 07 Jul 2004 Posts: 13
|
Posted: Fri Jul 30, 2004 10:18 am Post subject: Can anybody tell me |
|
|
Can any body tell me how to concatinate a string in smarty
eg
{$foo}
{$foo1}
{$foo.$foo1}
How is it done |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jul 30, 2004 10:44 am Post subject: |
|
|
{$foo}{$foo1} or
{"$foo$foo1"} or
{$foo|cat:$foo1} or
{"%s%s"|sprintf:$foo:$foo1} or
{$foo|string_format:"%s%s":$foo1}
maybe there are more ways... |
|
Back to top |
|
sandeepshinde Smarty Rookie
Joined: 07 Jul 2004 Posts: 13
|
Posted: Fri Jul 30, 2004 10:56 am Post subject: |
|
|
But if it is so that i want to pass an value to smarty plugin by concatination the string how can i do so.
eg
'{myfunction paramstring = $foo."some another value".$foo1}'
how could this be achived |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
sandeepshinde Smarty Rookie
Joined: 07 Jul 2004 Posts: 13
|
Posted: Fri Jul 30, 2004 11:15 am Post subject: |
|
|
I saw the link but it does not solve my problem
`coz
my eg was
eg
'{myfunction paramstring = $foo."some another value".$foo1}'
now the values are is some thing like this
$foo = "tbl_";
in between contains the template file name and all the paramterstring
$foo1="10"; |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jul 30, 2004 11:20 am Post subject: |
|
|
sandeepshinde wrote: | I saw the link but it does not solve my problem
`coz
my eg was
eg
'{myfunction paramstring = $foo."some another value".$foo1}'
|
{myfunction paramstring="`$foo`some another value`$foo1`"} |
|
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
|