Routes using param to chose which Controllers to use. |
Hello,
I have the same method name for a group of controllers: PHP Code: public function get_html(){ Intead of writing the complete route for every controller, is there a way to use params in routes to call different Controllers with the same method? Something like this: PHP Code: $routes->get('(:any)/get_html', '$1::get_html');
A dynamic controller is not allowed for security reasons.
So you need to extend Router. See https://codeigniter4.github.io/CodeIgnit...asses.html |
Welcome Guest, Not a member yet? Register Sign In |