我有此控制器:調用未定義的方法是CI_Controller ::控制器()
class Start extends CI_Controller{
var $base;
var $css;
function Start()
{
parent::Controller(); //error here.
$this->base = $this->config->item('base_url'); //error here
$this->css = $this->config->item('css');
}
function hello($name)
{
$data['css'] = $this->css;
$data['base'] = $this->base;
$data['mytitle'] = 'Welcome to this site';
$data['mytext'] = "Hello, $name, now we're getting dynamic!";
$this->load->view('testView', $data);
}
}
它告訴我在這一行:
父::控制器(); //錯誤在這裏。
Call to undefined method CI_Controller::Controller()
如果我刪除line..I得到一個錯誤,指出下一行..
Call to a member function item() on a non-object
我如何避免這樣的錯誤形式發生?
謝謝你,現在工作 – BlackFire27 2012-02-16 16:12:21