Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function _getControllerActions($controller)
- {
- $controller = explode('/', $controller);
- $appController = (count($controller) > 1? $controller[0] . 'AppController': 'AppController');
- $plugin = (count($controller) > 1? $controller[0] . '.': '');
- $controller = (count($controller) > 1? $controller[1]: $controller[0]);
- App::uses($controller . 'Controller', $plugin . 'Controller');
- App::uses($appController, $plugin . 'Controller');
- $methods = get_class_methods($controller . 'Controller');
- $defaultMethods = get_class_methods($appController);
- if ($methods == null) {
- return array();
- }
- if (is_array($defaultMethods)) {
- $methods = array_diff($methods, $defaultMethods);
- }
- foreach ($methods as $k => $v) {
- if ($v{0} == '_') {
- unset($methods[$k]);
- }
- }
- return array_values($methods);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement