If the Smarty template is resolved with the same name (path different), the resulting compiled file is overwritten by the issue

Source: Internet
Author: User
Tags smarty template
If the Smarty template is resolved with the same name (path different), the resulting compiled file is overwritten by the problem.
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? Smarty PHP

Share to:


------Solution--------------------
Give your directory structure
------Solution--------------------
Where's the smarty? How to configure and invoke?
------Solution--------------------
To observe how to solve this problem
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.