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

assigning value to a variable

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


Joined: 05 Jan 2004
Posts: 4

PostPosted: Tue May 04, 2004 6:38 am    Post subject: assigning value to a variable Reply with quote

I want to assign the output of a variable modifier to a variable.

For example:
{assign var="myvar" value={$path|replace:"code/":""|replace:".php":""} }

But this is not working and it is throwing some error. The error is:
Parse error: parse error, expecting `')'' in /file_path/templates_c/%%690/%%690164398/abc.tpl.php on line 123

Please help me

-- Navanee
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue May 04, 2004 6:43 am    Post subject: Reply with quote

Hi.

You can't nest delimiters like that. On the other hand, in your case, you needn't the inner ones. I haven't tested with this particular modifier chain, but this ought get rid of the particular error you recieved:

{assign var="myvar" value=$path|replace:"code/":""|replace:".php":""}
Back to top
View user's profile Send private message
rnavanee
Smarty n00b


Joined: 05 Jan 2004
Posts: 4

PostPosted: Tue May 04, 2004 7:25 am    Post subject: assigning value to a variable Reply with quote

Boots,

Thanks a lot. It worked!!!

-- Navanee
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 -> General 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