Welcome Guest, Not a member yet? Register   Sign In
routing multi params
#1
Exclamation 
(This post was last modified: 07-27-2020, 02:40 PM by pws.)

Hello,
i want create a route URL multiparams but without know the total of params, for example:

case 1: cours/type : online
case 2: cours/type:online/cat : cat1
case 3: cours/cat:cat1/subcat : subcat1
case 4:  cours/type:online/cat : cat1/subcat : subcat1
case 5: cours/cat:cat1/subcat : subcat1/type : online

so params not have exact ordering and exact params

How i can do this?

thanks..
Reply
#2

You could use a route like below.

PHP Code:
// will return all segments, needs to be the last route.
$routes->get('Controller/(:any)''Controller::cours/$1'); 

Then you would need to break it down using segment methods from the ncomingRequest Class.

SEE: CodeIgniter 4 User Guide - The Request URL
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB