Codeigniter 3 - Subdirectory structure - Routes

Asked

Viewed 338 times

4

I created a project in the IC and I am going through the following problem: I split my controllers into two folders:

application/controllers/painel/

and

application/controllers/site/

Being that in the panel subdirectory has the controller Home and the site also.

I wanted to set the site subdirectory home controler as the default controller. I tried to do this on the routes by placing:

$route['default_controller'] = 'site/home'

and also

$route['default_controller'] = 'site/index/home'

but it didn’t work, someone can help me???

  • If my answer has resolved, please accept the answer. If you have found the solution yourself, you can also post your answer to help others. Or you can ask for further clarification on my reply in the comments of the reply.

  • These routes are already configured this way. But what I really wanted was to set the home of the site directory as the default controller. Use routes this way do not define the default controller.

1 answer

3

In the archive application/config/routes.phpneed to add a route to each home. Would look like this:

$route['painel'] = "painel/home";
$route['site'] = "site/home";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.