Re: [SMARTY] Use config vars inside .php file (not the .tpl file)

From: Date: Thu, 13 Mar 2003 18:09:15 +0000
Subject: Re: [SMARTY] Use config vars inside .php file (not the .tpl file)
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8625@lists.php.net to get a copy of this message
get_config_var('foo'), or for a more direct method, FAQ config file section. http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions On Thu, 2003-03-13 at 11:20, Tom Henry wrote: > I am able to use config vars from inside > my template (.tpl) files OK -- > > But I cannot figure out > the syntax fo using config vars from within > the logic files (.php files) > > > > With the following config file: > > my.conf > --------- > $host = localhost > $db = customer_db > $user = root > $pwd = mypassword > --------- > > > And using the "config_load" method in my .php file - like this: > > some.php > -------- > $smarty->config_load('my.conf'); > > // example > // $link = mysql_connect("localhost", "root", "mypassword") > or die("Could not connect"); > > // How do I use my config variables to populate the following? > $link = mysql_connect($host, $user, $pwd) or die("Could not connect"); > > ------- > > I hope that aat least the question makes sense ;-) > > Many thanks for any help, > Tom -- Monte Ohrt <monte@ispi.net>

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