Re: Idle thoughts on dealing with the "multiple compiled template directory issue"

From: Date: Thu, 08 Mar 2001 00:39:04 +0000
Subject: Re: Idle thoughts on dealing with the "multiple compiled template directory issue"
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-343@lists.php.net to get a copy of this message
Monte, i think i drank to much coffee today, but i'll give it one last stab ... what im thinking is that with my idea, you dont need to specify a template directory at all. to display a template, you either fully qualify the name, or smarty will assume you mean the current directory. you still only need one compiled script directory (no sub directories needed at all). all compiled scripts go into the exact same directory. the naming convention simply helps maps the compiled script (which sits in the single $compile_dir), back to the its original directory , so we can determine whether or not the original template has been changed. Cliff Notes : no more need for $template_dir, instead we do explicity smarty->display("/path/to/template.tpl") or smarty assumes "/path/to/current/directory/template.tpl" if no path is specified. "/path/to/template.tpl" is converted to $compile_dir/@path@to@template.php (or $compile_dir/_path_to_template.php, or whatever). IOW, the path is converted to a literal which becomes a part of the compiled template's name (no sub-directories needed or created). if this is what you understood, then forget it. its just a thought ..... ----- Original Message ----- From: "Monte Ohrt" <monte@ispi.net> To: "clayton collie" <ccollie@cau.edu> Cc: <smarty@lists.ispi.net> Sent: Wednesday, 7. March 2001 19:04 Subject: Re: [smarty] Idle thoughts on dealing with the "multiple compiled template directory issue" > I got your point, but you might have missed mine :-) > If you look in the list archive, you will see this idea: > > $template_dir = (array("/path/to/templates1" => "/path1", > "/path/to/templates2" => "/path2", > "/path/to/templates3" => "/path3"); > > So Smarty would alias your template directories to a sub-dir of the > compiled template directory. Then in your template: > > {include file="/path2/index.tpl"} > > You can reference them just this way. > > you cannot put @ in place of / in the compiled template directory, they > must be real directories. The compiled version of the templates will be > calling <?php include("./templates/path2/index.tpl"); ?> so it needs > real directory names. > > clayton collie wrote: > >

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