牛骨文教育服务平台(让学习变的简单)
博文笔记

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

创建时间:2017-02-17 投稿人: 浏览次数:1833

  入手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.6htdocsci3applicationcontrollersBlog.php
Line: 16
Function: _error_handler


File: D:UPUPW_AP5.6htdocsci3index.php
Line: 316
Function: require_once




( ! ) Fatal error: Call to a member function model() on null in D:UPUPW_AP5.6htdocsci3applicationcontrollersBlog.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.6htdocsci3systemcoreCodeIgniter.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:



声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。