Code: Select all
protected function hasAction($child, $args = array()) {
if ($this->factory) {
$actionDetails = $this->factory->newAction( $child, $args );
$actionFile = $actionDetails->getFile();
$class = $actionDetails->getClass();
$method = $actionDetails->getMethod();
if (file_exists($actionFile)) {
$controller = $this->factory->newController( $actionFile, $class );
if (method_exists($controller, $method )) {
return true;
}
return false;
}
}
$action = new Action($child, $args);
if (file_exists($action->getFile())) {
require_once($action->getFile());
$class = $action->getClass();
$controller = new $class($this->registry);
if(method_exists($controller, $action->getMethod())){
return true;
}else{
return false;
}
} else {
trigger_error('Error: Could not load controller ' . $child . '!');
exit();
}
}