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

Can anybody tell me

 
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
sandeepshinde
Smarty Rookie


Joined: 07 Jul 2004
Posts: 13

PostPosted: Fri Jul 30, 2004 10:18 am    Post subject: Can anybody tell me Reply with quote

Can any body tell me how to concatinate a string in smarty

eg
{$foo}
{$foo1}

{$foo.$foo1}

How is it done
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 30, 2004 10:44 am    Post subject: Reply with quote

{$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
View user's profile Send private message Send e-mail Visit poster's website
sandeepshinde
Smarty Rookie


Joined: 07 Jul 2004
Posts: 13

PostPosted: Fri Jul 30, 2004 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 30, 2004 11:06 am    Post subject: Reply with quote

as a start, i recommend:
RTFM: http://smarty.php.net/manual/en/language.syntax.quotes.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sandeepshinde
Smarty Rookie


Joined: 07 Jul 2004
Posts: 13

PostPosted: Fri Jul 30, 2004 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 30, 2004 11:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail 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 -> 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