PHP View engine

Source: Internet
Author: User

1. A good view engine

(1). The template developed based on the engine is closer to the standard HTML.

(2). Easy to understand grammar

(3). Good caching issues

(4). Good extensibility

(5). More network resources

The view engine on the market: Smarty,phplib and other dozens of kinds, in PHP does not support object-oriented before there is a Smarty, now with a lot of people, or very cow x.

2. Introduce the benefits of Smarty: let PHP programmer and Art (HTML) separation, programmer to modify the business logic does not affect the interface, the art modification interface does not affect the business logic, and then more people cooperation is very important

Smarty.class.php is the main class

SmartyBC.class.php If the version upgrade some methods can not be used to introduce this kind of in

var obj=new Smarty ();

Obj->left_delimiter= ' {';//Left Delimiter

Obj->right_delimiter= '} '; right delimiter

Obj.->template_dir= ' TLP '; HTML template address

Obj->compile_dir= ' template_c '; template compile build file

Obj->cache_dir= ' cache '//caching

The following two configurations, because usually do not use the Smarty caching mechanism, so understand

obj->caching=true;//Open Cache

obj->cache_lifeime=200//Cache Time

Obj->assign (' arr ', $arr);//Complex value

Obj->display (YANG.TLP); template display

Official Address http:www.smarty.net/

Http:www.smarty.net/download

PHP View engine

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.