CodeIgniter Forums
routing with lang parameter in url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: routing with lang parameter in url (/showthread.php?tid=75946)



routing with lang parameter in url - abualk - 03-31-2020

Greetings, 
I'm trying to build multi language website that holds [en|es] . everything seems work fine for me except for the routing. 

I move index.php from public folder to main folder and did the required modification. 

my route.php file 
Code:
$routes->get('{locale}/login', 'Login::index');
$routes->get('{locale}/login/method2/(:any)', 'Login::Method2/$1');

routing seems to work fine, but only with one parameter. 
* what if I want to add more parameters?
* what if I want to have auto routing and not to add each function in the routing file?