|
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 |
rnavanee Smarty n00b
Joined: 05 Jan 2004 Posts: 4
|
Posted: Tue May 04, 2004 6:38 am Post subject: assigning value to a variable |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue May 04, 2004 6:43 am Post subject: |
|
|
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 |
|
rnavanee Smarty n00b
Joined: 05 Jan 2004 Posts: 4
|
Posted: Tue May 04, 2004 7:25 am Post subject: assigning value to a variable |
|
|
Boots,
Thanks a lot. It worked!!!
-- Navanee |
|
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
|