需要帮助php框架(codeigniter)
问题描述:
我知道php好。但我是一个非常新的学习者php框架。我学习codeigniter 2.0.3。我尝试开发一个简单的hello world应用程序。
I know php well. But I am a very new learner of php framework . I am learning codeigniter 2.0.3. I am trying to develop a simple hello world application.
我已经尝试过这个代码..
I have tried this code..
class Hello extends Controller{
function Hello(){
parent::Controller();
}
function you(){
$this->load->view("you_view");
}
}
但很遗憾, ...
致命错误:在C:\wamp\www\CodeIgniter\application\\ \\controllers\hello_world.php第7行
Fatal error: Class 'Controller' not found in C:\wamp\www\CodeIgniter\application\controllers\hello_world.php on line 7
答
Should be:
class Hello extends CI_Controller{
function __construct() {
parent::__construct();
/* use this only for setting default values,
loading helpers, models, ... */
}
function you() {
$this->load->view("you_view");
}
}