Welcome Guest, Not a member yet? Register   Sign In
Route error
#1

[eluser]marcoslavorato[/eluser]
Hi all. I have a quick question about the routes. Look my example.

Code:
$route['gerenciamento'] = "gerenciamento_controller/index/";
$route['gerenciamento/(.*)'] = "gerenciamento_controller/opcao/$1";
$route['gerenciamento/(.*)/ver/(:num)'] = "gerenciamento_controller/ver/$1/$2/";

The first and the second works fine, but the third does not work if the second is in the list. Why?
#2

[eluser]missionsix[/eluser]
The 3rd won't work because the 2nd matches all known cases of the 3rd route!

Re-order your routes like so:

Code:
$route['gerenciamento/(.*)/ver/(:num)'] = "gerenciamento_controller/ver/$1/$2/";
$route['gerenciamento/(.*)'] = "gerenciamento_controller/opcao/$1";
$route['gerenciamento'] = "gerenciamento_controller/index/";
#3

[eluser]marcoslavorato[/eluser]
Tanks missionsix.




Theme © iAndrew 2016 - Forum software by © MyBB