Php Codeigniter:访问自定义库函数的正确方法
我创建了一个名为Xauth.php的简单库,以检查用户是否已经登录:Php Codeigniter:访问自定义库函数的正确方法,php,codeigniter,Php,Codeigniter,我创建了一个名为Xauth.php的简单库,以检查用户是否已经登录: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Xauth { protected $ci; public function __construct() { $this->ci =& get_instance(); } public function is_lo
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Xauth
{
protected $ci;
public function __construct()
{
$this->ci =& get_instance();
}
public function is_logged_in()
{
if ($this->ci->session->userdata('is_logged_in'))
{
return true;
}
return false;
}
}
我的错在哪里 类必须使用小写字母:
$this->xauth->is_logged_in()
Message: Undefined property: Dashboard::$Xauth
$this->xauth->is_logged_in()