[英]Need help about php framework (codeigniter)
I know php well. 我很了解php。 But I am a very new learner of php framework . 但是我是php框架的新手。 I am learning codeigniter 2.0.3. 我正在学习codeigniter 2.0.3。 I am trying to develop a simple hello world application. 我正在尝试开发一个简单的hello world应用程序。
I have tried this code.. 我已经尝试过此代码。
class Hello extends Controller{
function Hello(){
parent::Controller();
}
function you(){
$this->load->view("you_view");
}
}
But unfortunately I am receiving this error ... 但不幸的是,我收到此错误...
Fatal error: Class 'Controller' not found in C:\\wamp\\www\\CodeIgniter\\application\\controllers\\hello_world.php on line 7 致命错误:在第7行的C:\\ wamp \\ www \\ CodeIgniter \\ application \\ controllers \\ hello_world.php中找不到类“ Controller”
Controller
应为CI_Controller
,如下所示:
class Hello extends CI_Controller{
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");
}
}
CI_Controller not Controller on CI_Controller不是控制器打开
class Hello extends Controller{
becomes 变成
class Hello extends CI_Controller{
Here more information , examples and user Guide. 这里有更多信息,示例和用户指南。 Check this 检查一下
Change Controller
to CI_Controller
in your code 在代码CI_Controller
Controller
更改为CI_Controller
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.