Smarty Templates_c Pre-compilation file issues

Source: Internet
Author: User
I have a development requirement is to write a INDEX.TPL template page, there is a link on the page, click will refresh the index page, href form such as href=index.php?act=xxx
, different links, the values of the Act are different, refresh the index page, the index.php section accepts the act value, through logical control, passing different variables to the INDEX.TPL page, and embedding a different sub-TPL page in INDEX.TPL based on the different values passed.
There is no problem with both the value and the logical judgment, but it is necessary to delete the precompiled files in the Templates_c directory each time before you can see the expected effect.
Add $smarty->force_compile = True to the index.php, solve the problem,

However, it is equivalent to forcibly shut down the Smarty pre-compilation function, as if not a professional solution, ask how to solve this problem, how to do not turn off the precompilation feature. But click the a link to see the desired effect. I am not very clear about pre-compiling this paragraph, ask a master AH.


Reply to discussion (solution)

Only 30 points, and then there are points to add it.

Do you need to write the plugin?
The original can be used Include_path label, now obsolete

has been resolved, you need to set a compile_id in the php file.

  • 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.