1

I config a router

'users/user(/fields=:fname,:lname,:age)?'   => 'users/user/$1/$2/$3',

used: /users/user/fields=John,Smith,33 (fname = John, lname = Smith, age = 33)

I want config like
users/user?fields=John,Smith,33

but I can't use "?" in a router.

QHu91_IT
  • 189
  • 2
  • 12

1 Answers1

0

Routing does not include GET parameters as they are not considered part of the URI. For the functionality that you desire you would be better off specifying a closure as the right hand side of the route and returning the constructed string.

'users/user' => function(){ 
    return 'users/user/' //Custom logic goes here to build the internal URI
}
Emlyn
  • 852
  • 6
  • 16