找不到Codeigniter控制器

编程入门 行业动态 更新时间:2024-10-22 02:58:03
本文介绍了找不到Codeigniter控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在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控制器

本文发布于:2023-11-01 02:17:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547961.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   控制器   Codeigniter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!