Welcome Guest, Not a member yet? Register   Sign In
How to setup a single route with optional argument
#14

I found the current behavior came from CI3.

Code:
$route['login/(.+)'] = 'auth/login/$1';

In the above example, if the $1 placeholder contains a slash, it will still be split into multiple parameters when passed to Auth::login().
https://www.codeigniter.com/userguide3/g...xpressions

So it seems difficult to fix it as a bug.

First, I sent a PR to improve the documentation.
https://github.com/codeigniter4/CodeIgniter4/pull/8340

And I will try to add an option to pass multiple URI segments as one parameter.
Reply


Messages In This Thread
RE: How to setup a single route with optional argument - by kenjis - 12-16-2023, 05:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB