Thinkphp supports a variety of PHP template engines, which can be configured according to individual needs.
Below we take Smarty template engine as an example, to everybody said the specific operation Flow!
First go to smarty official online download a smarty. Site Download Address: http://www.jb51.net/codes/16086.html.
Next unzip the package, there will be two folders: Demo and libs. Open the Libs folder and copy all content.
Next, open the Thinkphp folder under the root directory of your site. Inside has a vendor folder, this folder is the TP calls the third party class library to use, has just copied the thing all to paste over.
After you open the configuration file for your project, you should conf.php the file in the Conf directory of your project directory.
Add the following configuration:
' Tmpl_engine_type ' => ' Smarty '
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
)
So you can use the Smarty template.
The file location of the template has not changed and the cache location has not changed.