Thinkphp supports a variety of PHP template engines that can be configured to suit individual needs.
The first step:
First go to smarty official online download a smarty.
Step Two:
Unzip the tarball, there will be two folders: Demo and libs. Open the Libs folder and copy all the contents.
Step Three:
Open the Thinkphp folder in the root directory of your Web site. There is a vendor folder, this folder is TP call third-party class library, new Folder Smarty, paste the copied content.
Fourth Step:
Open the configuration file for your project and you should conf.php the file in the Conf directory of your project directory.
Add the following configuration:
If you want to configure more, you can also add '
Tmpl_engine_config ' =>array (' Caching ' =>true, ' template_dir ' =>tmpl_path, ' Compile_dir ' =>cache_path, ' Cache_dir ' =>temp_path)
This way you can use the Smarty template. The file location of the template has not changed and the cache location has not changed.
Transferred from: http://www.shangxueba.com/jingyan/1917208.html
thinkphp using Smarty