我在应用程序/库文件夹中有一个类 - 文件名 = person_struc.php 并且代码如下..
class Person_struc {
var $person_id;
var $person_name;
public function set_info($person_id, $person_name) {
$this->person_id = $person_id;
$this->person_first_name = $person_name;
}
}
我有一个视图(person_list.php)并希望按如下方式加载类 -
$this->load->library('person_struc');
$this->person_struc->set_info(1,"xxx");
我有控制器(人)和模型(person_model)。但它正在产生错误..
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$person_struc
Filename: person/person_list.php
Fatal error: Call to a member function set_info() on a non-object in
我试图解决问题但失败了。请问有什么解决办法吗...