Пример #1
0
 public function getTpl($config)
 {
     list($group, $subGroup, $controller, $action) = explode(':', $config['controller']);
     $className = 'src\\' . $group . '\\Controller\\' . $subGroup . '\\' . $controller . 'Controller';
     $action = $action . 'Action';
     $this->route->setAction($action);
     $this->route->setParameters(isset($config['parameters']) ? $config['parameters'] : array());
     return $this->container->doAction($className, $action, isset($config['parameters']) ? $config['parameters'] : array(), $this->container->getRequest());
 }
Пример #2
0
 /**
  * do the controller
  *
  * @param  routing config
  * @return string
  */
 public function controller($config)
 {
     list($group, $subGroup, $controller, $action) = explode(':', $config['controller']);
     $className = 'src\\' . $group . '\\Controller\\' . $subGroup . '\\' . $controller . 'Controller';
     $action = $action . 'Action';
     $this->route->setAction($action);
     $this->route->setParameters(isset($config['parameters']) ? $config['parameters'] : array());
     $response = $this->container->doAction($className, $action, isset($config['parameters']) ? $config['parameters'] : array(), $this->request);
     \EventDispatcher::dispatch('kernal.response', new HttpEvent($response));
 }