Smarty是一个使用PHP写出来的模板引擎,是目前业界最著名的PHP模板引擎之一。它分离了逻辑代码和外在的内容,提供了一种易于管理和使用的方法,用来将原本与HTML代码混杂在一起PHP代码逻辑分离。简单的讲,目的就是要使PHP程序员同前端人员分离,使程序员改变程序的逻辑内容不会影响到前端人员的页面设计,前端人员重新修改页面不会影响到程序的程序逻辑,这在多人合作的项目中显的尤为重要。
Notable 3.1 changes/features:
- Smarty 2 BC removed from codebase, use SmartyBC.class.php for this
- Full UTF-8 compatibility with all plugins
- Default Template Handler for handling non-exiting template files
- Default Config Handler for handling non-exiting config files
- Default Plugin Handler for handling non-exiting plugin files
- {block hide} feature when no corresponding child block is found
- {setfilter}{/setfilter} to apply filters to a specific block of template code
- Improved Template Resource API
- Improved Cache Resource API
- Relative paths in template files {include file="../header.tpl"}
- Access to specific $template_dir via array index
- Access multiple template resources with extends: feature
- Simple global HTML escapement option with escape_html property
- Compile-Check on cache miss option
- Automatic template recompile on Smarty upgrade
- New Getters/Setters for main Smarty directory configuration
暂无评论