CodeIgniter Forums
Routing problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Routing problem (/showthread.php?tid=68862)



Routing problem - oizo - 09-05-2017

Hi,

I have this following routing rules :


PHP Code:
$route['my-custom-url'] = 'lead/index/1';
$route['my-another-custom-url'] = 'lead/index/2';
$route['my-again-another-custom-url'] = 'lead/index/3';

$route['my-custom-url/(:any)'] = 'lead/$1/1';
$route['my-another-custom-url/(:any)'] = 'lead/$1/2';
$route['my-again-another-custom-url/(:any)'] = 'lead/$1/3'

I have a controller "LeadController" with index method. It display a form that is different depending on the parameter "type" (1, 2, or 3).

The form action url is /lead/post/TYPE.

After the post action, i would like to redirect to a result page with followin url : /my-custom-url/result (where "my-custom-url" is the input url in the LeadController).

Can you tell me if it's possible or if, on the contrary, it's an conception error ?

Thanks.