Arrays in config files
| From: | camel at 74mail dot ru | Date: | Sat, 23 Oct 2004 05:36:52 +0000 |
| Subject: | Arrays in config files | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11921@lists.php.net to get a copy of this message | ||
Hi. Not so far i found that using arrays in config usefull for definin
errors, but i can't find functionalyti that help me define arrays for options or
radios.
I wrote some changes in Config_File.class.php.
Exsample who it works:
orders.cnf
TypeOptions[option_value1]=options_name1
TypeOptions[option_value1]=options_name1
orders.php
$smarty->config_load('orders.cnf');
$conf = $smarty->get_config_vars();
$smarty->assign('TypeOptions', $conf['TypeOptions']);
order.tpl.html
{html_radios options=$TypeOptions selected=$type name='type'
separator='<br>'}
I think it's very usefull.
In attach Config_File.class.php with small changes, changes mark with
//BEGIN changes
... some code with my changes
//END changes
Thank you Bigildeev Artem(camel)
----------------------
http://74mail.ru/