Re: [SMARTY] Hidden [.Section] config vars in php file
| From: | Monte Ohrt | Date: | Fri, 14 Mar 2003 04:15:59 +0000 |
| Subject: | Re: [SMARTY] Hidden [.Section] config vars in php file | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8638@lists.php.net to get a copy of this message | ||
You can set $config_read_hidden to true momentarily, but I like to use the Config_File class directly (see the FAQ in the wiki)
Monte
Tom Henry wrote:
After learning to gain access to config vars in my /php files (thanks for the help earlier today) the urge to refine got the best of me... Now I find that I cannot see how to get access to the vars in "hidden" sections of conf files that are loaded into the .php file: Example: my.conf ----------- globalvar = some global value // "hidden" section [.Database] password = mydatabasepasswd // Also: tested with NOT "hidden" section // [Database] // password = mydatabasepasswd ----------- my.php ----------- // This does work when "not hidden" syntax // is used in the config file // But does NOT work when [.Database] is "hidden" with the "." (dot) $smarty->config_load('my.conf','Database'); $cfg_vars = $smarty->get_config_vars(); // var_dump($cfg_vars); // Use this to check and prove we have it extract($cfg_vars); // database calls using $mydatabasepasswd ... ... ------------ Again - I am NOT expecting the "hidden" section vars to be accessible in the .tpl files - only in the .php files Am I missing some syntax/subtlety (or is this a feature ;-) TIA, Tom Henry