If the duplicate name of the smarty template is solved (different paths), the compiled file will be overwritten. Smarty PHP
If the duplicate name of the smarty template is solved (different paths), the compiled file will be overwritten.
For example
File 1
// $ Obj_tpl is the smarty object $ obj_tpl-> setTemplateRoot (dirname (_ FILE _); $ obj_tpl-> display ("index. tpl ");
File 2
// $ Obj_tpl is the smarty object $ obj_tpl-> setTemplateRoot (dirname (_ FILE _); $ obj_tpl-> display ("index. tpl ");
File 1 and file 2 are not in the same path. The content of the two index. tpl files is also different.
Compile the file
/Template_c/% 117/% 1172603085
As a result, file 1 and file 2 are opened in a browser and then the same index. tpl is applied.
I want to automatically apply the index. tpl of my path. How can this problem be solved?
Reply to discussion (solution)
Give your directory structure
/Mod/zhuanti0402/
Include
Index. php
Index. tpl
/Mod/zhuanti0528/
Include
Index. php
Index. tpl
/Template_c/This is a mess.
I didn't separate the directories of php and tpl template files because only one php and one tpl are required. One page is complete.
Where is smarty? How to configure and call it?
The call is like this.
$ Obj_tpl = JATUtility: UseSmarty ();
Is there configuration?
Observe how to solve this problem
I have also encountered this problem. The solution is as follows: 1. change the file name instead of using the same file name; 2. redefine compile_dir before using the smarty template each time.