CodeIgniter Forums
Controller directory with subfolders - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Controller directory with subfolders (/showthread.php?tid=64359)



Controller directory with subfolders - kaaai3 - 02-12-2016

is there a way to make sub folders in the controller directory because i have a panel with a post controller etc

controllers
  panel
    Posts.php

pages.php


RE: Controller directory with subfolders - InsiteFX - 02-12-2016

Just create a route to it, sub-folders will not work with the default controller.


RE: Controller directory with subfolders - kaaai3 - 02-12-2016

(02-12-2016, 09:59 AM)InsiteFX Wrote: Just create a root to it, sub-folders will not work with the default controller.

yeah how?


RE: Controller directory with subfolders - condor - 02-12-2016

I do like this:

File .htaccess in the application root:

Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]


application\config\config.php

Code:
$config['index_page'] = ' ';

application\config\routes.php

Code:
$route['default_controller'] = 'index';

And create folder.

application\controller\panel\

In the catalog necessary controllers.