Re: [SMARTY] Method Request
| From: | Monte Ohrt | Date: | Thu, 20 Feb 2003 19:28:43 +0000 |
| Subject: | Re: [SMARTY] Method Request | ||
| References: | 1 2 3 4 5 6 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8036@lists.php.net to get a copy of this message | ||
On Thu, 2003-02-20 at 13:09, Tom Sommer wrote:
> "Paul Lockaby" <lockaby@vt.edu> wrote in
> news:3E55272D.9090306@vt.edu...
> > Assigned, definitely. As both Tom and I have said, this will speed up
> > execution by not having to load the config file twice. While
> > config_load() is meant to mimic the functionality, I think that it can
> > and should be extended to do more for the programmer. Personally, I
> > store all of my configuration information in a template file, like
> > database information, mail server information, site information, color
> > information, etc. This makes one easy file for someone to edit in order
> > to change a whole bunch of variables.
>
> Yes, you need to run config_load() before being able to fetch config vars
>
> I was requesting this because I need those config options in my SQL strings,
> and so I need to fetch it in the PHP code, not in the template code
In my case, I keep this kind of stuff in config files, but in hidden
sections:
[.database]
dbhost = db-host
dbname = foo
dbuser = joe
dbpass = blah
Hidden sections can NOT be loaded into the templates, so I load up a
separate instance of the Config_File class and get the vars directly
from the config files.
In some cases (like above), loading the vars into the templates is an
unnecessary step, unless you want to access vars that will get assigned
anyways. Typically you don't want things like database config info
accessible from within the templates!
Thoughts?
>
> Starting to love smarty and the way the community around it works... now
> please respond to my "Compile time" thread :(
Yes, well I was hoping someone that uses compiler functions might answer
that. I'll have to dig into the code to see what your problem is. There
just isn't enough hours in the day for free support :( Andrei also wrote
this portion of the code, and he has been inactive in development for
many months since he moved to his new job.
Monte