protected function getChild($child, $args = array()) { $action = new \Core\Action($child, $args); if (file_exists($action->getFile())) { require_once __modification($action->getFile()); $class = $action->getClass(); $controller = new $class(); $controller->{$action->getMethod()}($action->getArgs()); return $controller->getOutput(); } else { return ''; } }
/** * Returns child output * @param string $child * @param array $args * @return string */ protected function getChild($child, &$args = array()) { $action = new \Core\Action($child, $args); if (file_exists($action->getFile())) { require_once __modification($action->getFile()); $class = $action->getClass(); $controller = new $class(); $controller->{$action->getMethod()}($action->getArgs()); return $controller->output; } else { trigger_error('Error: Could not load controller ' . $child . '!'); exit; } }