解決ThinkPHP Call to a member function assign() on a non-object


<ignore_js_op> 


assign是tp模板輸出變量的一個方法.沒有object只能說沒實例化...
<ignore_js_op> 

經過幾番思索,終於發現了.原來是Action里有構造函數覆蓋了父類的構造函數.
正確應該這樣.調用一下父類的構造函數.
<ignore_js_op> 

跑去父類看看
<ignore_js_op> 


其實真正寫應該是放在public function _initialize() {里面


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Thinkphp----------Call to a member function free_result() on a non-object [yii]Trying to get property of non-object Trying to get property 'art_id' of non-object C/C++ error: no matching member function for call to 安裝GD庫解決ThinkPHP 驗證碼Call to undefined function Think\imagecreate()出錯 Laravel 避免 Trying to get property of non-object 錯誤的六種方法 [新增第六種 data_get] TP框架上傳致命錯誤: Call to a member function validate() on null的問題 解決 Cannot assign to read only property 'exports' of object '#' 問題 no matching function for call to ‘std::basic_string ::assign(std::string&, int) Cannot assign to read only property 'exports' of object 解決辦法
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM