Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!
I have controller Home and function Type($param)
At URL i set value Home/Type/2 and get value 2.
But if i want send unlimited number params insted 2, for example /2/4/5/6/7 etc.

How i must write route in file routes.php?
I tried such:
$route['home/type/(:any)'] = "home/type/$1";
Posted

1 solution

Hello,

You can define your route as shown below
$route['home/type/(:any)/(:any)/(:any)/(:any)/(:any)'] = "home/type/$1/$2/$3/$4/$5";

Another solution can be found here[^].

Regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900