CodeIgniter:根据所选的控制器名称显示方法名称

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!

Your close - include the class you want to call then do this;

$class_methods = get_class_methods('myclass');
// or
$class_methods = get_class_methods(new myclass());

foreach ($class_methods as $method_name) {
    echo "$method_name
";
}

For CodeIgniter do this;

get_class_methods($this);

So an example is;

class myclass extends CI_Controller {

  public function __construct() {

            parent::__construct();

            var_dump(get_class_methods($this));
        }

}