|
<?php
class Myclass{
private $url_model;//所访问的模块,如:music
private $url_method;//所访问的方法,如:create
private $CI;
function __construct(){
$this->_CI = &get_instance();
}
public function Myfunction($params){
var_dump($this->_CI->load->library('session'));
/* var_dump($this->CI); */
/* var_dump(class_exists("CI_Controller")); */
/* $this->_CI = &get_instance();
var_dump($this->CI->router->class); *//* $this->_CI->load->view("welcome_message"); */
/* var_dump($this->CI); */
/* echo BASEPATH.'core/Controller.php'; */
}
}
?>
前端打印出来的
Fatal error: Call to a member function view() on a non-object in F:\wamps\www\CodeIgniter2\admin\application\hooks\Myclass.php on line 13
那个函数和类确实已经加载了。为什么这个实例 就是没用
求高手解答
|
|