Exemplo n.º 1
0
 /**
  * @param	MvcContextInterface		$context
  * @param	MvcRouteDetailInterface $detail
  * @return	null
  */
 public function setupView(MvcContextInterface $context, MvcRouteDetailInterface $route, $format)
 {
     if ($route->isView() && !$route->isManualView()) {
         $context->setViewFormat($format);
         $view = $this->createTemplate($format);
         $context->setView($view);
         if ('html' === $format) {
             if ($route->isViewPackage()) {
                 $config = $this->createHtmlPageConfiguration(AF_RESOURCE_URL, AF_IS_RESOURCE_BUILD);
                 $config->applyView($route->getViewPackage(), $view);
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * @param	string	$routeKey
  * @param	MvcContextInterface $context
  * @return	MvcContextInterface
  */
 public function callWithContext($routeKey, MvcContextInterface $context)
 {
     $dispatcher = $this->getDispatcher();
     $tmp = $this->getMvcFactory()->createContext($routeKey, $context->getInput());
     $tmp->load($context->getAll());
     $dispatcher->dispatch($tmp);
     /* transfer all assignments made by mvc action */
     $context->load($tmp->getAll());
     $view = $tmp->getView();
     if (!empty($view)) {
         $context->setView($view);
     }
     return $context;
 }