CI3框架初识-控制其使用注意-Call to a member function model() on null in

来源:互联网 发布:java模块化编程 编辑:程序博客网 时间:2024/05/29 14:22

  入手ci3 在使用model处理数据的时候发现各种报错,结果是控制器中的构造方法需要加载父类构造方法


报错提示如下 :  Fatal error: Call to a member function model() on null in


报错例子如下:


A PHP Error was encountered


Severity: Notice


Message: Undefined property: Blog::$load


Filename: controllers/Blog.php


Line Number: 16


Backtrace:


File: D:\UPUPW_AP5.6\htdocs\ci3\application\controllers\Blog.php
Line: 16
Function: _error_handler


File: D:\UPUPW_AP5.6\htdocs\ci3\index.php
Line: 316
Function: require_once




( ! ) Fatal error: Call to a member function model() on null in D:\UPUPW_AP5.6\htdocs\ci3\application\controllers\Blog.php on line 16
Call Stack
# Time Memory FunctionLocation
1 0.0002 145256 {main}( )...\index.php:0
2 0.0026 147632 require_once( 'D:\UPUPW_AP5.6\htdocs\ci3\system\core\CodeIgniter.php' )...\index.php:316
3 0.0363 318920 Blog->__construct( )...\CodeIgniter.php:518
A PHP Error was encountered


Severity: Error


Message: Call to a member function model() on null


Filename: controllers/Blog.php


Line Number: 16


Backtrace:



0 0
原创粉丝点击