Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param null|RenderingContextInterface $context
  */
 public function __construct(RenderingContextInterface $context = NULL)
 {
     if (!$context) {
         $context = new RenderingContext($this);
         $context->setControllerName('Default');
         $context->setControllerAction('Default');
     }
     $this->setRenderingContext($context);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param TemplatePaths $paths
  * @param RenderingContext $context
  * @param FluidCacheInterface $cache
  */
 public function __construct(TemplatePaths $paths, RenderingContext $context = NULL, FluidCacheInterface $cache = NULL)
 {
     if (!$context) {
         $context = new RenderingContext();
         $context->setControllerName('Default');
         $context->setControllerAction('Default');
         $context->setVariableProvider(new StandardVariableProvider($this->variables));
         $context->injectViewHelperVariableContainer(new ViewHelperVariableContainer());
     }
     $this->templatePaths = $paths;
     $this->viewHelperResolver = new ViewHelperResolver();
     $this->setRenderingContext($context);
     $this->setTemplateCompiler(new TemplateCompiler($this->viewHelperResolver));
     $this->setTemplateParser(new TemplateParser($this->viewHelperResolver));
     $this->templateCompiler->setTemplateCache($cache);
 }
Exemplo n.º 3
0
 /**
  * @param string $action
  * @return void
  */
 public function setControllerAction($action)
 {
     $action = lcfirst(pathinfo($action, PATHINFO_FILENAME));
     parent::setControllerAction($action);
     $this->controllerContext->getRequest()->setControllerActionName($action);
 }