Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
can I assign new config variable dinamically in smarty

 
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
jmut
Smarty Rookie


Joined: 25 Aug 2005
Posts: 20

PostPosted: Wed Jan 04, 2006 3:15 pm    Post subject: can I assign new config variable dinamically in smarty Reply with quote

I would like to set config variable to some other value.

For example #colspan# is 9 when you run the script.


I would like based on other variable to make

$smarty.config.colspan = $other_variable - 1 for example
and from this point forward #colspan# to be 8.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7038
Location: Lincoln Nebraska, USA

PostPosted: Wed Jan 04, 2006 3:19 pm    Post subject: Reply with quote

You can't assign config variables, you can only read them.

You might accomplish the need another way:

Code:
{math equation="x-y" x=#colspan# y=1 assign="newcolspan"}


then use {$newcolspan} from that point forward.
Back to top
View user's profile Send private message Visit poster's website
jmut
Smarty Rookie


Joined: 25 Aug 2005
Posts: 20

PostPosted: Wed Jan 04, 2006 3:23 pm    Post subject: Reply with quote

mohrt wrote:
You can't assign config variables, you can only read them.

You might accomplish the need another way:

Code:
{math equation="x-y" x=#colspan# y=1 assign="newcolspan"}


then use {$newcolspan} from that point forward.


10x
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks 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