php smarty 手册下载,smarty教程
smarty完全中文手冊也就是smarty教程,smarty是比較常用的模板編譯引擎,次手冊包含模板設計者篇和模板程序員篇兩個部分,從多方位分析了smarty的高級特點,用戶徹底了解smarty的功能和使用方法,有需要的朋友可以下載參考。
手冊簡介:
smarty手冊是php模板引擎的一個中文說明文檔,當我們遇上了許多的技術難題的同時,“什么是模板應該做的,什么不該做”這個問題,也被熱烈的討論著。從這些經驗,我們決定應該用Php將模板引擎寫成一個類,讓任何覺得合適的人使用它。所以我們寫了一個引擎,從此就有了smarty.
常見問題解答
Smarty/PHP errors錯誤
Smarty can catch many errors such as missing tag attributes or malformed variable names. If this happens, you will see an error similar to the following:
Smarty能夠發現許多類似缺少標簽屬性或者不規范變量名這樣的錯誤。如果發生這種錯誤,就會有下面的錯誤提示:
Example 17-1. Smarty errors錯誤
Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'
in /path/to/smarty/Smarty.class.php on line 1041
警告:Smarty: 在index.tpl文件第4行,語法錯誤:'%blah'標簽未知
Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name
in /path/to/smarty/Smarty.class.php on line 1041
嚴重錯誤:Smarty: 在index.tpl文件第28行,語法錯誤:缺少節段名字在 /path/to/smarty/路徑中的Smarty.class.php文件1041行
Smarty shows you the template name, the line number and the error. After that, the error consists of the actual line number in the Smarty class that the error occured.
Smarty可以顯示模板名稱以及行號和錯誤。這些錯誤顯示未所發生錯誤所屬的smarty類所在的實際行號。
There are certain errors that Smarty cannot catch, such as missing close tags. These types of errors usually end up in PHP compile-time parsing errors.
某些錯誤Smarty不能捕捉,像缺少結束標簽。這些類型的錯誤通常會在在php分析語法錯誤的編譯時間中就捕捉出來了.
Example 17-2. PHP parsing errors
Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75
When you encounter a PHP parsing error, the error line number will correspond to the compiled PHP script, not the template itself. Usually you can look at the template and spot the syntax error. Here are some common things to look for: missing close tags for {if}{/if} or {section}{/section}, or syntax of logic within an {if} tag. If you can't find the error, you might have to open the compiled PHP file and go to the line number to figure out where the corresponding error is in the template.
當你遇到一個php解析錯誤時,錯誤行號將反應到php編譯腳本,而不是模板本身。通常,你會看到模板并發現語法錯誤。通常會發現:缺少if}{/if} 或者
{section}{/section}的結束標簽。或者{if}標簽內的邏輯語法錯誤。如果你不能檢查出錯誤,那就得在模板中打開php編譯文件按照行號找出相應錯誤。
總結
以上是生活随笔為你收集整理的php smarty 手册下载,smarty教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: execl筛选去重_Excel中表格筛选
- 下一篇: 动态规划算法php,php算法学习之动态