I am confused with codeigniter routing. I am implementing URL masking in my project by using router in codeigniter.
From this I got confusion about the routing.routes has given below.
$route['project/shareToFacebook/(:any)']="project/shareToFacebook/$1";
$route['project/shareToFacebook/(:any)']="project/profile/$1";
My question is when I called the controller shareToFacebook what does route will do?
whether controller profile will be invoke or the controller shareToFacebook will be invoke?
CodeIgniter user guide: Routing
You will always be sent to
shareToFacebook, but you will be sent to any of these routes only if you pass some parameters so when you will call the controller it will open it’s index method regardless, if you won’t pass any arguments.