Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Strange behaviour

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Margodth
Smarty Rookie


Joined: 28 Mar 2004
Posts: 11

PostPosted: Fri Jun 17, 2005 4:23 am    Post subject: Strange behaviour Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Jun 17, 2005 5:38 am    Post subject: Reply with quote

You need something like unique compile_id's.

http://smarty.php.net/manual/en/api.display.php
Back to top
View user's profile Send private message
Margodth
Smarty Rookie


Joined: 28 Mar 2004
Posts: 11

PostPosted: Fri Jun 17, 2005 2:13 pm    Post subject: Reply with quote

boots wrote:
You need something like unique compile_id's.

http://smarty.php.net/manual/en/api.display.php


Even though, the $force_compile didn't have to recompile the template?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Jun 17, 2005 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP