|
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 |
Kryllster Smarty Rookie
Joined: 22 Sep 2007 Posts: 25
|
Posted: Sat Aug 16, 2008 4:16 am Post subject: Will this work?? |
|
|
I am trying to make a set of variables available to all templates and the only solution I can think of is in a config file so will this code
Code: | {* Availabe to all templates *}
$smarty->assign('gold',$gold);
$smarty->assign('rubies',$rubies);
$smarty->assign('diamonds',$diamonds);
{* Level Array *}
$level = array(10,30,90,180,300,500,700,900,1000,1200,1400,1600,1600,1800,2000,2200,2400,2600,2800,3000,3200,3400,3600,4000);
|
work as a config file?? Just wonering how to do this??
Thanks |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Aug 16, 2008 5:35 pm Post subject: |
|
|
In order to store arrays in a config file you must set $smarty->config_overwrite = false. See http://www.smarty.net/manual/en/variable.config.overwrite.php for further information.
If you want to place the variables $gold, $rubies and $diamonds into a configfile you have to write a sript doing that. |
|
Back to top |
|
Kryllster Smarty Rookie
Joined: 22 Sep 2007 Posts: 25
|
Posted: Mon Aug 18, 2008 1:20 am Post subject: |
|
|
Thank You for the reply. I'm looking into it. |
|
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
|