For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2004 > Arrays in config files









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Arrays in config files
camel@74mail.ru

2004-10-23, 3:57 am

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/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com