I have 2 dropdown in one of my web page build with CodeIgniter. First dropdown is Controller Name and second one is Method Name. I am able to pull all controllers from controllers directory by using get_filenames()
and showing their names in the dropdown option. Now when user choose a controller name from first dropdown I want to show all methods name declared on that model file in the second dropdown.
I'll do an ajax call and populate the second dropdown as per first dropdown selection. My question is how can I get methods name as per controller selected.
This is what I have tried. Note $data['controller']
is the controller name I'm posting via ajax. This is showing method name but it also showing method name of class from which I have extended my controller class. I only want the method names declared on the controller itself.
$myClass = require_once($this->config->item('APP_FULL_PATH').'controllers/' . $data['controller'] . ".php");
print_r(get_class_methods(new $data['controller']()));
Any idea how to do that!