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.