Re: Idle thoughts on dealing with the "multiple compiled template directory issue"
| From: | Monte Ohrt | Date: | Thu, 08 Mar 2001 00:04:38 +0000 |
| Subject: | Re: Idle thoughts on dealing with the "multiple compiled template directory issue" | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-342@lists.php.net to get a copy of this message | ||
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:
>
> Monte,
> you may have misunderstood (quite possible, since i reread my post and
> nearly confused myself). there would still only be one compiled script
> directory. this system would permit us to have multiple template
> directories.
>
> we would just use a naming convention which would related a compiled script
> back to its original template, regardless of its directory. IOW when
> compiling, you would do the following to derive the compiled script name
>
> (1) split the template name into its fully qualified virtual path and the
> filename (call this $path, $template)
> if not path is given, just set $path to the current directory
> (2) $compiled_name = replace_extension( $template, ".php" )
> (3) $path = str_replace("/", "@", $path )
> (4) $compiled_name = $compile_dir . "/$path$compiled_name"
>
> of course the same process is used when Smarty::fetch is called
>
> the whole point of the exercise is to get around the limitation of only one
> compile directory/template directory. using this convention, for example,
> you keep the system as it is (1 compile dir), while allowing any number of
> template directories, and avoiding namespace conflicts to boot ...
>
> ----- Original Message -----
> From: "Monte Ohrt" <monte@ispi.net>
> To: "clayton collie" <ccollie@cau.edu>
> Cc: <smarty@lists.ispi.net>
> Sent: Wednesday, 7. March 2001 17:56
> Subject: Re: [smarty] Idle thoughts on dealing with the "multiple compiled
> template directory issue"
>
> > The compiled templates must be in real directories. they are php scripts
> > you know, and they include each other.
> >
> > clayton collie wrote:
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/