コード例 #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
ファイル: Controller.php プロジェクト: phpsa/CoreCMS
 /**
  * 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;
     }
 }