新手的 问题,关于报错的
<?phpclass Insert extends __Construt{
function insert(){
parent::Controller();
$this->load->database();
}
function index(){
$this->load->view('insertnewsView');
}
functioninsertnews(){
$data=array(
'username'=>$_POST['username'],
'password'=>$_POST['password'],
);
$this->load->model('insertModel');
$this->insertModel->insert($data);
echo "插入数据成功";
}
}
?>
这是我的代码为什么检测运行的时候报错:Fatal error: Call to undefined method CI_Controller::controller() in D:\AppServ\www\mykingdom\application\controllers\insert.php on line 6
求帮忙 本帖最后由 jeongee 于 2011-7-15 16:58 编辑
class Insert extends __Construt{
这是什么东西
CI2.0以上这样写
extends CI_Controller{
function __construct(){parent::__construct();}
}
2.0之前的这样写
extends Controller{
function __construct(){parent::__Controller();}
}
PS:好好看下PHP的基础
必须的谢谢, LZ连基础也没打好~这么快就上框架啦~
页:
[1]