Welcome Guest, Not a member yet? Register   Sign In
Routes using param to chose which Controllers to use.
#1

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'); 
Reply
#2

A dynamic controller is not allowed for security reasons.

So you need to extend Router.
See https://codeigniter4.github.io/CodeIgnit...asses.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB