codeigniter、datamapper 和 ion_auth 错误让我很困惑
当我打电话时 -
$o = new Order();
codeigniter 给了我这个错误 -
A PHP Error was encountered
Severity: Notice
Message: Undefined property: order::$ion_auth_model
Filename: libraries/Loader.php
Line Number: 1035
Fatal error: Call to a member function _assign_libraries() on a non-object in C:\xampplite\htdocs\portraits\system\libraries\Loader.php on line 1035
目前订单模型除了 datamapper 1.8 的 _template 中的内容之外没有做任何事情,
这是订单表的数据库模式
CREATE TABLE IF NOT EXISTS `orders` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`image_path` int(11) NOT NULL,
`status` enum('new','progress','completed','sent') NOT NULL,
`placed` date NOT NULL,
`updated_date` date NOT NULL,
`will_send` int(1) NOT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
这是我试图做的..
$o->user_id = $user->id;
$o->status = 'new';
$o->placed = unix_to_human(time(), TRUE, 'eu');;
$o->will_send = 1;
任何指导为什么 CI 试图将身份验证模型加载到用户类?或者我在这里缺少什么?
when i call this-
$o = new Order();
codeigniter gives me this error-
A PHP Error was encountered
Severity: Notice
Message: Undefined property: order::$ion_auth_model
Filename: libraries/Loader.php
Line Number: 1035
Fatal error: Call to a member function _assign_libraries() on a non-object in C:\xampplite\htdocs\portraits\system\libraries\Loader.php on line 1035
At the minute the order model isnt doing anything other than whats in the _template from datamapper 1.8
here is the db schema for the order table
CREATE TABLE IF NOT EXISTS `orders` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`image_path` int(11) NOT NULL,
`status` enum('new','progress','completed','sent') NOT NULL,
`placed` date NOT NULL,
`updated_date` date NOT NULL,
`will_send` int(1) NOT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
This is what i was trying to do..
$o->user_id = $user->id;
$o->status = 'new';
$o->placed = unix_to_human(time(), TRUE, 'eu');;
$o->will_send = 1;
any guidance on why CI is trying to load the auth model to the user class? or what am i missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$this->ion_auth->order;
或$this->ion_auth_model->order;
)您是否在以下位置调用了 CI 超类订单类?如果您尝试访问 CodeIgniter 的类和函数,则必须在 Order 类中获取 CI 实例。例如;
$this->ion_auth->order;
or$this->ion_auth_model->order;
)Did you call CI superclass in Order class? If you trying to do access CodeIgniter's classes and functions, you have to get the CI instance inside Order class. Eg;