Smarty PHP
If the Smarty template is resolved with the same name (path different), the resulting compiled file is overwritten by the problem.
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 contents of the 2 INDEX.TPL files are also different.
After running, compile the file to
/template_c/%%117/%%1172603085
Causes the file 1 and file 2 to be opened with a browser and apply the same index.tpl.
I want to implement the INDEX.TPL that automatically apply my own path respectively. How does this work?
Reply to discussion (solution)
Give your directory structure
/mod/zhuanti0402/
Contains
index.php
Index.tpl
/mod/zhuanti0528/
Contains
index.php
Index.tpl
/template_c/, it's all messed up here.
I did not separate the PHP and TPL template files from the directory because it would only take 1 PHP, one TPL. One page is all solved.
Where's the smarty? How to configure and invoke?
The call is like this
$obj _TPL = Jatutility::usesmarty ();
So, there's a configuration for this?
To observe how to solve this problem
This question I also met, at present I solve the scheme: 1, change the file name, do not use the same file name, 2, each use Smarty template before redefining Compile_dir