簡體   English   中英

如何清除Smarty錯誤或啟用調試

[英]How to clear Smarty error or enable debugging

當我在Smarty中遇到問題時,我會收到骯臟的錯誤消息。

如何啟用調試模式或如何獲得清除錯誤消息?

這是一個示例錯誤:

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'list.tpl'' in
H:\Server\FrameWork\smarty\libs\sysplugins\smarty_internal_templatebase.php:127 
Stack trace: #0 H:\Server\FrameWork\smarty\libs\sysplugins\smarty_internal_templatebase.php(374):
Smarty_Internal_TemplateBase->fetch('news/li...', NULL, NULL, NULL, true) #1 
H:\Server\news\list.php(157): Smarty_Internal_TemplateBase->display('news/li...') #2 
H:\Server\news\news.php(24): include('H:\Serve...') #3 H:\Server\sec.php(13): 
include('H:\Serve...') #4 {main} thrown in 
H:\Server\FrameWork\smarty\libs\sysplugins\smarty_internal_templatebase.php on line 127

那是“回溯”或“堆棧跟蹤”-它向您顯示程序中發生錯誤的確切點,並追溯到代碼的最外部。

最有用的東西是:

  1. 第一行是一個非常合理的錯誤消息:'無法加載模板文件'list.tpl'
  2. 在提到Smarty內部部分的各行之后,您可以看到H:\\Server\\news\\list.php(157) 因此,在文件H:\\Server\\news\\list.php第157行上,您要求Smarty渲染模板,這就是錯誤的出處。

因此,在這種情況下,您似乎有一行PHP代碼要求Smarty渲染不存在的模板。 很難想象還能提供更多的信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM