ci框架子类继承父类时,报错Fatal error: Class ‘BaseController‘ not found in C:\xampp\htdocs「建议收藏」

ci框架子类继承父类时,报错Fatal error: Class ‘BaseController‘ not found in C:\xampp\htdocs

大家好,又见面了,我是全栈君。

ci框架子类继承父类时,报错Fatal error: Class ‘BaseController‘ not found in C:\xampp\htdocs「建议收藏」

 

i have created a controller menus.php which extends basecontroller as follows

<?php
class Menus extends BaseController {
    function __construct()
    {
        parent::__construct();

    }
}
?>

and BaseController.php in application/core folder as follows

<?php
class BaseController extends CI_Controller {
    function __construct()
    {
        parent::__construct();
    }
}
?>

I m getting error as Fatal error: Class ‘BaseController’ not found in

The class file name must begin with “MY_” unless you’ve changed it in config.php.

$config['subclass_prefix'] = 'MY_';

https://ellislab.com/codeIgniter/user-guide/general/core_classes.html

ci框架子类继承父类时,报错Fatal error: Class ‘BaseController‘ not found in C:\xampp\htdocs「建议收藏」ci框架子类继承父类时,报错Fatal error: Class ‘BaseController‘ not found in C:\xampp\htdocs「建议收藏」

 

修改config.php文件中$config[‘subclass_prefix’] = ‘MY_’; 这个配置就OK

参考:https://stackoverflow.com/questions/28698521/fatal-error-class-basecontroller-not-found-in-c-xampp-htdocs

https://stackoverflow.com/questions/33431597/class-basecontroller-not-found

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/111620.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • mysql一次查询,返回多个统计结果

    mysql一次查询,返回多个统计结果

    2021年5月16日
    153
  • 欧式距离、标准化欧式距离、马氏距离、余弦距离

    欧式距离、标准化欧式距离、马氏距离、余弦距离目录欧氏距离标准化欧氏距离马氏距离夹角余弦距离汉明距离曼哈顿(Manhattan)距离1.欧式距离欧式距离源自N维欧氏空间中两点x1,x2x1,x2x_1,x_2间的距离公式:d=∑i=1N(x1i−x2i)2‾‾‾‾‾‾‾‾‾‾√d=∑i=1N(x1i−x2i)2d=\sum_{i=1}^N\sqrt{(x_{1i}-x_{2i})^2}2.标准化…

    2022年6月19日
    21
  • python安装cpickle_python中cPickle

    python安装cpickle_python中cPickle在python中,一般可以使用pickle类来进行python对象的序列化,而cPickle提供了一个更快速简单的接口,如python文档所说的:“cPickle–Afasterpickle”。cPickle可以对任意一种类型的python对象进行序列化操作,比如list,dict,甚至是一个类的对象等。而所谓的序列化,我的粗浅的理解就是为了能够完整的保存并能够完全可逆的恢复。在cPic…

    2022年6月15日
    53
  • java 线程interupt stop(dep)[通俗易懂]

    java 线程interupt stop(dep)[通俗易懂] java线程interuptstop(dep) https://blog.csdn.net/zbw18297786698/article/details/53432879/1、Java中API自带的stop()方法,来终止线程       查阅JDK,不难发现Thread提供了一个stop()方法,但是stop()方法是一个被废弃的方法。为什么sto…

    2025年8月3日
    4
  • java中executeQuery()方法

    java中executeQuery()方法介绍使用 JDBC 连接数据库需要 4 步 executeQuery 方法是第四步执行查询 要用 statement 类的 executeQuery 方法来下达 select 指令以查询数据库 executeQuery 方法会把数据库响应的查询结果存放在 ResultSet 类对象中供我们使用 举例如下 Stringstr9 selectsnofro

    2025年7月11日
    7
  • strftime函数

    strftime函数strftime函数用于接收时间元组,并返回以可读字符串表示的当地时间,格式由参数format决定(格式参数在本章前一节有详细介绍)。例如:01#!/usr/bin/envpython02#–coding:UTF-8–0304importtime0506t=(2018,7,17,17,3,1,1,1,0)07t=time.mktime(t)08print(time.strftime(“%b%d%Y%H:%M:%S”,time.gmtime(t)))执行结果如下:Jul

    2025年8月25日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号