예제 #1
0
파일: Response.php 프로젝트: phpsa/CoreCMS
 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 '';
     }
 }
예제 #2
0
 /**
  * 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;
     }
 }