Re[2]: Cache names not persist to current directory change
Dmitry Koteroff <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
>> MM>> yes. if you didn't configure template_dir with an absolute path you
>> MM>> are effectively using two different template_dirs when changing the
>> MM>> pwd. you need a distinct compile_dir for each template_dir you use.
>> DK> Great.
>> Maybe add something like $smarty->temp_prefix which will be added
>> to each compiled filename (and caches) to make them unique? I
>> have a lot of directories with templates, and I have to set own
>> cache directory for each of them - thousands of subdirectories!
MM> you can:
MM> - pass a compile_id (unique for each template-dir) to display()
It is exactly what I need, thanks!
I use something about
$smarty->compile_id = preg_replace('{[\\\\/:]}', '_', dirname($fname));
$smarty->fetch($fname);
I see that cache names is also depend on compile_id, and it's
great.
--
Best regards,
Dmitry Koteroff.
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php