Ron Kirkland
Ron Kirkland

Reputation: 3

CodeIgniter will not load a specific controller

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.

Upvotes: 0

Views: 102

Answers (1)

TimBrownlaw
TimBrownlaw

Reputation: 5507

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 {

Upvotes: 1

Related Questions