Welcome Guest, Not a member yet? Register   Sign In
Is it possible to use dynamic controller name in routing?

I want to use route localization like said here https://codeigniter.com/user_guide/outgo...#in-routes
So I need to add route rule like:
PHP Code:

But I want to make this rule for all controllers - not to specify rules for all controllers. So I added the rule:
PHP Code:

I have controller "Login" with method "index()". When I go to "mydomain.com/Login" method "index()" is loaded successfull. But when I go to "mydomain.com/en/Login" (as I expect to use my route) I got 404 Error with message - "Controller or its method is not found: \App\Controllers$1::index". But locale is defined and set correctly.

If I change my route to
PHP Code:

then "mydomain.com/en/Login" is loaded successfull as I want. But in this way I have to set routes for every controller and I want to set one route to work with all controllers.

Is it possible to set route with setting of dynamic controller name?

Theme © iAndrew 2016 - Forum software by © MyBB