dongsaolian8786 2017-08-01 23:45
浏览 32
已采纳

CodeIgniter不会加载特定的控制器

I am having a weird issue in which CodeIgniter (3.1) will not load a specific controller. I can load other controllers, but when I create a controller with the name sppb, using any case combination, and save the file as sppb.php it does not load.

<?php
    defined('BASEPATH') OR exit('No direct script access allowed');

   class Sppb extends CI_Controller {
      public function __construct()
      {
        parent::__construct();
      }

      public function index()
      {
      }
}

Above is the entire controller and it is saved to the server with the corresponding name of sppb.php.

I have also taken a different controller that I can load, copied it into a new file, changed the name to sppb, saved it to the server and it still will not load.

This is on a Linux server and I have checked the case in the naming of the file and the Controller.

  • 写回答

1条回答 默认 最新

  • dqrnsg6439 2017-08-01 23:59
    关注

    Your Class file name needs to be 1st letter upper case... like

    Sppb.php
    

    The same applies to your class names

    class Sppb extends CI_Controller {
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀