Re: [SMARTY] accessing configs files from php

From: Date: Tue, 09 Jul 2002 13:17:47 +0000
Subject: Re: [SMARTY] accessing configs files from php
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5238@lists.php.net to get a copy of this message
Yes you can use the Config_File class directly. $conf = new Config_File; // change yes|true|on and no|false|off to boolean values $conf->boolean = true; // overwrite same named vars, or accumulate array $conf->overwrite = true; // get global vars $foo = $conf->get('english.conf'); // get one global var $foo = $conf->get('english.conf',null,'var_name'); // get var from section $foo = $conf->get('english.conf','section_name','var_name'); Peter Kmet wrote:
Hello, i have all my language strings in configs/english.conf & japanese.conf I wonder if there is a way to read these strings from php script. Sometimes it will be usefull to use it in php code too, and i don't want to have 2 separate language files I know that i can use $smarty->_config[0]["vars"] but i need to call $smarty->display() before it.... Thanks Peter
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#5238) next »