|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Margodth Smarty Rookie
Joined: 28 Mar 2004 Posts: 11
|
Posted: Fri Jun 17, 2005 4:23 am Post subject: Strange behaviour |
|
|
I have 2 templates with the same name in diferent folders.
my code looks something like this
Code: |
$template = new Smarty();
$template->cache_dir = $root_path . 'smarty/cache/';
$template->template_dir = $root_path . 'templates/' . $uiTemplate . '/' . $uiMod ;
$template->compile_dir = $root_path . 'smarty/templates_c/';
|
The templates have the same name but they are in diferent folders. The result is that will show the first template compiled, and the second shows the content of the first file.
To avoid this behaviour I used $force_compite but nothing happens.
I check the compiled file and in every reload of the page of these two diffs templates, the file doesn't change, and of course the name is always the same %%F1^F1A^F1A4EE0E%%header.htm.php
I think that this is a bug. If it isn't sorry about it!
Sorry about my english.. it is not my native language. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
|
Back to top |
|
Margodth Smarty Rookie
Joined: 28 Mar 2004 Posts: 11
|
Posted: Fri Jun 17, 2005 2:13 pm Post subject: |
|
|
Even though, the $force_compile didn't have to recompile the template? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Jun 17, 2005 11:05 pm Post subject: |
|
|
I am unsure what the behaviour with force_compile=true would be in this instance. I think it is fair to assume that it is "undefined". If you want to use a structure as the one you are suggesting, you will have to take appropriate measures such as a unique compile_id, or unique compile_dir and cache_dir or perhaps using unique custom resources. As you discovered, Smarty will otherwise always hash to the same name and that is the real issue. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|