Arm Peev
Arm Peev

Reputation: 128

Codeigniter subfolder named like controller

I'm trying to make folder in controller folder with exact name like controller in Codeigniter. Is it possible by some trick or something?

Screenshot here: https://i.sstatic.net/sJnbe.png

Upvotes: 0

Views: 114

Answers (3)

Devin Young
Devin Young

Reputation: 841

EDIT

I incorrectly viewed the first time and thought manage.php was outside the manage folder.

It will work, but your URL will just have "manage" twice. You could change the routes config to remove the first "manage", but it will be less confusing and time-consuming to just name manage.php something different.

Upvotes: 0

Diego Castro
Diego Castro

Reputation: 2156

There is no problem in using the same name, but it is confusing. The best solution would be to change the name, but you can use just fine.

Remember to use the routes with 'manage/manage/function'.

Upvotes: 0

Andrei Zhamoida
Andrei Zhamoida

Reputation: 1464

If it will be like

/controllers/manage/manage.php

you should add in /config/routes.php

$route['manage/(.*)'] = "manage/manage/$1";
$route['manage'] = "manage/manage";

Upvotes: 1

Related Questions