• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
controllers in subfolder - not working

I am new to CI and trying to build a PHP application.
As it is going to be a fairly big application I need to put my controllers in sub folders according their functionality to organize it better.

I have created a folder named app under controllers folder

I have put two files in it

Createapp.php code:

   class Creatapp extends CI_Controller {
     public function index() {
      //load the helpers
      echo "test";

application.php code:

   class Application extends CI_Controller {
     public function index() {
         echo "testapp";

I am facing trouble in accessing createapp controller whereas the application controller is working fine.

If I access http://localhost/testapp/index.php/app/application/
I am able to access it successfully

If I access http://localhost/testapp/index.php/app/createapp/
I get a 404 not found error.

I am not sure what I am doing wrong. Please help!!

Sorry, guys my mistake.. I just figured out.

There was difference between the php file name and class name.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.