Re: [SMARTY] Running several instances of smarty.

Jan Rosier <[email protected]> Thu, 01 Jun 2006 12:31:28 +0200
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
Marcus Bointon wrote:
> On 1 Jun 2006, at 04:58, Tony K. wrote:
>
>> I would like to run several subdomains using smarty.  Each subdomain
>> would be a separate instance of smarty.  Can I use the same folders
>> (i.e. template, template_c, cache, configs) for more than one instance
>> of Smarty?
>>
>> /domain/template
>> /domain/template_c
>> /domain/cache
>> /domain/configs
>> /domain/subdomains/subdomain1
>> /domain/subdomains/subdomain2
>
> Yes. Just set $smarty->template_dir to an absolute path. You will run 
> into problems with name clashes however - e.g. if domain 1 and 2 both 
> have an index.tpl, they will point at the same file. Alternatively, 
> you could create a new resource type that managed multiple template 
> locations: http://smarty.php.net/manual/en/template.resources.php
Or use compile_id to avoid name clashes.
For example:
$smarty->compile_id = $_SERVER['HTTP_HOST'];


Greetings,
Jan Rosier

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php