0

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.

3
  • class Sppb extends CI_Controller Commented Aug 2, 2017 at 0:00
  • Partly right, but my main issue was the Filename also needed to be uppercase. Thanks for helping. Commented Aug 2, 2017 at 0:34
  • Just like docs say. Commented Aug 2, 2017 at 5:26

1 Answer 1

1

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 {
Sign up to request clarification or add additional context in comments.

2 Comments

I had previously commented that I had tried this, then I reread your response. You are right. I had not for some reason tested with both File and Class uppercased. Thanks for the help.
I was kind of betting on that... Glad it was worth the gamble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.