/** * On the post parse event, add the "layoutName" variable to the variable container so it can be used by the TemplateView. * * @param ViewHelperNode $node * @param array $arguments * @param TemplateVariableContainer $variableContainer * @return void */ public static function postParseEvent(ViewHelperNode $node, array $arguments, VariableProviderInterface $variableContainer) { if (isset($arguments['name'])) { $layoutNameNode = $arguments['name']; } else { $layoutNameNode = 'Default'; } $variableContainer->add('layoutName', $layoutNameNode); }
/** * Returns TRUE if the current template has a template defined via <f:layout name="..." /> * * @return boolean */ public function hasLayout() { return $this->variableContainer->exists('layoutName'); }