|
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 |
srini_Vk Smarty n00b
Joined: 29 Jun 2007 Posts: 2
|
Posted: Fri Jun 29, 2007 12:56 am Post subject: Changing existing variable value in template |
|
|
I have a variable called {$shipping.rate}.
I would like to change its value to 100. None of the following is worked:
1. {$shipping.rate=100}
2. {assign $shipping.rate=100}
3. {assign var=$shipping.rate value=100}
How do I change this. |
|
Back to top |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
|
Back to top |
|
srini_Vk Smarty n00b
Joined: 29 Jun 2007 Posts: 2
|
Posted: Fri Jun 29, 2007 10:57 am Post subject: |
|
|
Hi,
I'm very new to smarty. Mine is just a variable not an array. Can you tell me how to change its value.
Thanks, |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Fri Jun 29, 2007 11:27 am Post subject: |
|
|
$shipping.rate is not just a Variable. $shipping is an Array and you seem to want to change it's item indexed by 'rate'.
You're gonna have to go with shannera's solution. _________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
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
|