[英]The page you requested was not found codeigniter 3
I have setup the codeigniter, default controller is working(welcome.php) but when i add new controller its not working 我已经设置了codeigniter,默认控制器正在工作(welcome.php),但是当我添加新控制器时它不工作
Default controller : 默认控制器:
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->load->view('welcome_message');
}
public function testing()
{
$this->load->view('test');
}
}
http://localhost/appointment/index.php/welcome/ (working) http://localhost/appointment/index.php/welcome/ (正在运行)
New controller 新控制器
class democontroller extends CI_Controller {
public function index()
{
$this->load->view('test');
}
}
http://localhost/appointment/index.php/democontroller/ (not working) http://localhost/appointment/index.php/democontroller/ (不起作用)
Change the following code: 更改以下代码:
class democontroller extends CI_Controller {
}
to 至
class Democontroller extends CI_Controller {
}
and save this file with name Democontroller.php
and try again. 并保存此文件,名称为
Democontroller.php
然后重试。
Note: controller name first character must be capital as per naming convention. 注意:根据命名约定,控制器名称的第一个字符必须为大写。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.