1. 程式人生 > >ThinkPHP5.0網站報錯,模板檔案不存在:throw new TemplateNotFoundException('template not exists:' . $template, $te

ThinkPHP5.0網站報錯,模板檔案不存在:throw new TemplateNotFoundException('template not exists:' . $template, $te

ThinkPHP5.0網站報錯,模板檔案不存在

 

背景:

本地測試一切正常,網站上線後,提示模版檔案不存在,經過對“控制器”的除錯,可以確定是“指向”模板的程式碼存在異常

起初:

 //渲染
        return $this->view->fetch('item_list');

修改後:

 //渲染
        return $this->view->fetch('Itemlist/item_list');


只需要在指向的地方前面加“檢視資料夾名字”

 

個人感覺:(不知道對不)

估計是環境影響,造成了 指向檢視得加 檢視的資料夾名


特別感謝:qq暱稱為“獨門絕技”大神協助