A route to the same controller forever plus several functions

1

I have the following link meusite.com/admin/concursos/concursos . My folders inside controllers look like this:

-admin
  +atos
  -concursos
    ->concursos.php
  +licitacoes

This link takes the index function of the controller , admin and the administrative panel folder, concursos and the folder to controller , and the last concursos of the link and controller concursos.php .

If I create the route $route['admin/concursos/'] = 'admin/concursos/concursos'; it takes me through the link meusite.com/admin/concursos normal to index , more precise that same route is always take me to other functions without having to be creating a route for a new function like for example: meusite.com/admin/concursos/visualizar/1 , meusite.com/admin/concursos/editar/1 .

Is it possible for a route to respond to all those links?

    
asked by anonymous 16.08.2017 / 03:14

1 answer

2

I have decided as follows:

$route['admin/concursos'] = 'admin/concursos/concursos';
$route['admin/concursos/(.*)'] = 'admin/concursos/concursos/$1';

The first route indicates that whenever I use url admin\concursos will take me to index of controller , already the second route indicates that I can specify the function that I will call within controller .

I can also do this only in the following way:

$route['admin/concursos/(.*)'] = 'admin/concursos/concursos/$1';

I also need to report index on url admin\concursos\index

    
16.08.2017 / 16:30