Thinkphp process and considerations for using the Smarty template engine
In the multi-person cooperation project, the Smarty template uses the most, the specific reason Baidu.
The template used by default in thinkphp is Think's own template, which requires modifying the default template engine variables.
The steps are as follows:
① defines the following configuration items in config.php
' Tmpl_engine_type ' = ' Smarty ',
② previous step has switched the template engine, CSS style if there is {}, you need to use the {literal} tag to prohibit Smarty parsing, using the {literal}{/literal} tag is included.
③ If you use custom system variables such as $think.const.css_url (note that you can use the thinkphp template, such as the abbreviated form of $think.css_url, if the industry CSS references However, you cannot omit const! when switching to a smarty template. Change the keyword $think to $smarty (note that the beginning of the letter is lowercase).
The ④TP engine replaces key constants such as __controller__ __module__, etc., Smarty engine is not replaced and needs to be set to: {$smarty. const.__controller__} parsed out.
Considerations for migrating Smarty Templates with TP templates in TP frame