PHP模板引擎 Smarty 3.1.0 發布
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
本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!