Beispiel #1
0
 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 '';
     }
 }
Beispiel #2
0
 public function controller($route, $args = array())
 {
     $action = new \Core\Action($route, $args);
     return $action->execute();
 }
Beispiel #3
0
 /**
  * Test whether or not the Action has a specific action
  * @param string $child
  * @param array $args
  * @return boolean
  */
 protected function hasAction($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();
         if (method_exists($controller, $action->getMethod())) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }