ThinkPHP supports multiple php template engines and can be configured as needed.
The following uses the Smarty template engine as an example to describe the specific operation process!
First download a Smarty from the Smarty official website. Site: http://www.jb51.net/codes/16086.html.
Next, decompress the package and there will be two folders: demo and libs. Open the libs folder and copy all the content.
Next, open the thinkphp folder under the root directory of your website. There is a vendor folder, which is used by TP to call a third-party class library. paste all the copied items.
Then open the configuration file of your project. The file conf. php should be in the conf directory of your project directory.
Add the following Configuration:
'Tmpl _ ENGINE_TYPE '=> 'smarty'
If you want to configure more, you can add
'Tmpl _ ENGINE_CONFIG '=> array ('caching' => true, 'template _ dir' => TMPL_PATH, 'compile _ dir' => CACHE_PATH, 'cache _ dir' => TEMP_PATH)
In this way, you can use the Smarty template.
The file location of the template has not changed, and the cache location has not changed.