views:

87

answers:

1

I have a small problem with Smarty... I have two different template files in two different directories that happen to have the same name. Unfortunately Smarty gets them confused. It uses the last one to be updated to create a compiled file in its /templates_c folder, which it then uses to display the page.

This means that both files end up looking like the last one to be updated, even thought they're completely different.

I can solve this by renaming one of the files, or presumably calling clear_compiled_tpl. I was wondering, however, if there's a better way. Isn't there a way to configure Smarty to pay attention to the folder a template file is in when creating its compiled files?

Edit: I'm using Smarty v2.6.19

+2  A: 

Try this before outputting your templates, it's actually an optimization for directories with thousands of template files, but might fix your problem:

$smarty->use_sub_dirs = true;
karim79
That seems to work, thanks
Manos Dilaverakis