ThinkPHP method for using the smarty template engine _ PHP Tutorial

Source: Internet
Author: User
Tags php template smarty template
ThinkPHP uses the smarty template engine. 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, go to the Smarty official website. 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.

Bytes. The following uses the Smarty template engine as an example to describe the specific operation process! First go to the Smarty official website...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.