我已经在codeigniter中创建了一个控制器。问题是,当我在URL中命中控制器名称和函数名称时,它给了我找不到404的错误。我是Codeigniter的新手,我不明白我要去哪里哪里
I have create a controller in codeigniter. The problem is that when I hit the controller name and function name in url then Its give me error that 404 not found. I am new to codeigniter and I did not understand where I am going wrong
这是我的控制器
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); class Home extends CI_Controller{ function __construct(){ parent::__construct(); } function you(){ $this->load->view('home_view'); } } ?>我的看法是这样的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="www.w3/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My First CodeIgniter Practice</title> </head> <body> <h1> HELLO CI Buddy...!</h1> </body> </html>我正在codeigniter上创建我的第一个项目,但我一直陷在这个问题中。我已经尝试了大多数解决方案从stackoverflow,然后我问这个问题。因此,我的要求是不要添加此问题重复。我想要解决我的问题。
I am creating my first project on codeigniter and I stuck in this problem.I already try most of the solution from the stackoverflow and after that I asking this question. So Its my request not to add this question to duplicate. I want solution for my problem. any help is appreciable
谢谢
推荐答案您的问题可能是由于由于以下任何原因
Your issue may be due to any of the following reason
- 控制器文件名的首字母应为大写字母,即Home.php。
- 请检查您的主页文件名
- 如果问题出在您的URL中,请使用URL localhost / w3crud / index.php / home / you ,然后编辑您的.htaccess文件
更多推荐
找不到Codeigniter控制器
发布评论