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