-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
route bug or not? #470
Comments
It's not a bug. It's the regular expressions that you're using. Both However, it also looks like you're basically re-creating the "magic" routing that CI has always had that matches up a controller/method with the URI segments. That feature still works in CI4. |
My English is not well, i actually mean |
Ah. When matching a namespace to a physical file, each directory is separated by a Second is how the escaping happens in the string itself. The combination of
So again, this is not a bug. That's a language issue you're dealing with there. |
I'm using ci with vue, vue has it route, i set Home::index is vue's index.html
And i want route /api/(.*?)/(:any) -> \App\Controllers$1::$2
$routes->add('api/(.*?)/(:any)', '$1::$2'); $routes->add('(:any)', 'Home::index');
It doesn't work and i print some var find out $1 never changed only $2 changed, when i write like this
$routes->add('api/(.*?)/(:any)', '\App\Controllers\\\$1::$2'); $routes->add('(:any)', 'Home::index');
This will work, is this a bug or just it's way?
The text was updated successfully, but these errors were encountered: