Smarty is the auto-cached template?
Like what
$obj _tpl is the Smarty object
$obj _tpl->settemplateroot (dirname (__file__));
$obj _tpl->display ("Index.tpl");
Then I have 2 directories, each with index.tpl,php files and index.tpl together. That means there are 2 sets of templates.
I found the second directory read the INDEX.TPL of the first directory.
I used it.
$obj _tpl->caching=false;
$obj _tpl->clear_all_cache ();//Clear All caches
$obj _tpl->clear_cache (' index.tpl ');//Clear INDEX.TPL Cache
It doesn't work either.
The value of DirName (__file__) is different for each directory.
Can't I use a template file with the same name? The path is different. Smarty
Share to:
------Solution--------------------
You should see the PHP and HMTL compiled files, not the cache.
------Solution--------------------
Typically smarty template files are stored in the Templates directory, and the compiled template files are stored in the Template_c directory
Smarty does not cache the template because the template is user and he has no right to intervene
Smarty just reads the template file and compiles it into a php file for actual runtime use
It's not clear what you mean by "2 directories."
If this "2 directory" is two items, then this "2 directories" should have template and Template_c subdirectories respectively
If this "2 directory" is a different style for the same project, then this "2 directories" should be placed in the template subdirectory
You should bring the directory name when you use it
$obj _tpl->display ("style 2/index.tpl");