【发布时间】:2014-07-05 20:01:42
【问题描述】:
这是我的控制器:普通:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Common extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function test(){
echo 1;
}
}
这是第二个控制器(寄存器):
class Register extends Common {
public function __construct() {
parent::__construct();
}
public function user_registration(){
$this->test();
}
}
当我访问 user_registration 函数时,它显示了这个错误: 致命错误:在第 3 行的 /home/attilana/domains/attila-naghi.com/public_html/application/controllers/register.php 中找不到“Common”类
如何在类寄存器的 user_registration 函数中从类 common 访问 test() 函数?
【问题讨论】:
标签: codeigniter class controller extends