Routes of Codeigniter

1

I'm using Codeigniter and only the route

$route['default_controller'] = 'welcome';

is working, when I make an example:

$route['teste'] = "welcome";

It gives me the following message Can not GET /codeigniter/index.php/test . Could anyone tell me what it could be? This folder containing the codeigniter is inside another application

    
asked by anonymous 05.08.2014 / 21:09

2 answers

1

The routes in the codeigniter are to name paths, for example in your case the default route when opening the index of the page is:

$route['default_controller'] = 'welcome';

Where default_controller means that is the name for the new path and welcome and the controller of this path, in the controller that loads the view that in the case is the visual page.

It can also be an error for you to make two calls to a controller on different routes, in this case I do not know if it is possible or not, it is probably possible.

In your case he is reporting that he could not find the controller welcome. Try switching from "welcome" to 'welcome' and see if the controller welcome still exists inside the application / controller folder.

for more questions maybe this link will help you:

link

But if you do not know how to work with MVC and codeigniter will have some work to do what you want.

This site has great content on codeigniter and people who have been working for a long time with this one, I prefer laravel mainly to work with routes, but I already used codeigniter in two previous work.

Att. Thiago Prado

    
06.08.2014 / 02:47
0

You have already declared your default route.

 $route['default_controller'] = 'welcome';

If you want to call the controler teste you must change the default control to $route['default_controller'] = 'teste';

    
27.10.2017 / 02:26