src/Context/DefaultRenderContext.php
/**
     * Renders a subtemplate
     *
     * @param string|TemplateInterface|BoundTemplateModelInterface|array $template
     * @param mixed $additionalInfo
     */
Renders a subtemplate
@param string|TemplateInterface|BoundTemplateModelInterface|array $template
@param mixed $additionalInfo
Renders a subtemplate @param string|TemplateInterface|BoundTemplateModelInterface|array $template @param mixed $additionalInfo
public function renderSubTemplate($template, $additionalInfo = NULL) {
        $render = AbstractRender::getCurrentRender();
        if(method_exists($render, 'renderTemplate')) {
            $tmp = NULL;
            if($template instanceof BoundTemplateModelInterface) {
                _InternalBoundModelTemplate::$current = new _InternalBoundModelTemplate($template, $tmp);
                $template = $template->getTemplate();
            }
            if($template instanceof TemplateInterface || $template instanceof RenderableInterface)
                $tmp = $template;
            else {
                $tc = $this->templateController;
                if(is_string($template)) {
                    if($templates = $this->getRenderInfo()->get( RenderInfoInterface::INFO_SUB_TEMPLATES )) {
                        $tmp = $templates[$template] ?? NULL;
                        if(is_callable( $tmp ))
                            $tmp = call_user_func($tmp);
                        if(is_array($tmp) || $tmp instanceof TemplateInterface)
                            $template = $tmp;
                    }
                }
                if(is_array($template) && $tc instanceof OrganizedTemplateControllerInterface) {
                    $tmp = $tc->findTemplateWithTags($template);
                }
                if(is_string($template)) {
                    if($tc instanceof OrganizedTemplateControllerInterface)
                        $tmp = $tc->findTemplateWithName($template);
                    else
                        $tmp = $tc->getTemplate($template);
                }
            }
            if($tmp instanceof RenderableInterface) {
                $tmp->renderContents($additionalInfo);
                return;
            }
            if(!($tmp instanceof TemplateInterface)) {
                $e = new TemplateNotFoundException(is_string($template) ? "Requested sub template $template not found" : "Requested sub template not found");
                $e->setTemplateID((string) $tmp);
                throw $e;
            }
            $render->renderTemplate($tmp, $additionalInfo);
            _InternalBoundModelTemplate::$current = NULL;
        }
    }
public function renderSubTemplate ( $ template , $ additionalInfo = NULL ) { $ render = AbstractRender :: getCurrentRender ( ) ; if ( method_exists ( $ render , 'renderTemplate' ) ) { $ tmp = NULL ; if ( $ template instanceof BoundTemplateModelInterface ) { _InternalBoundModelTemplate :: $ current = new _InternalBoundModelTemplate ( $ template , $ tmp ) ; $ template = $ template -> getTemplate ( ) ; } if ( $ template instanceof TemplateInterface || $ template instanceof RenderableInterface ) $ tmp = $ template ; else { $ tc = $ this -> templateController ; if ( is_string ( $ template ) ) { if ( $ templates = $ this -> getRenderInfo ( ) -> get ( RenderInfoInterface :: INFO_SUB_TEMPLATES ) ) { $ tmp = $ templates [ $ template ] ?? NULL ; if ( is_callable ( $ tmp ) ) $ tmp = call_user_func ( $ tmp ) ; if ( is_array ( $ tmp ) || $ tmp instanceof TemplateInterface ) $ template = $ tmp ; } } if ( is_array ( $ template ) && $ tc instanceof OrganizedTemplateControllerInterface ) { $ tmp = $ tc -> findTemplateWithTags ( $ template ) ; } if ( is_string ( $ template ) ) { if ( $ tc instanceof OrganizedTemplateControllerInterface ) $ tmp = $ tc -> findTemplateWithName ( $ template ) ; else $ tmp = $ tc -> getTemplate ( $ template ) ; } } if ( $ tmp instanceof RenderableInterface ) { $ tmp -> renderContents ( $ additionalInfo ) ; return ; } if ( ! ( $ tmp instanceof TemplateInterface ) ) { $ e = new TemplateNotFoundException ( is_string ( $ template ) ? " Requested sub template  $ template  not found " : " Requested sub template not found " ) ; $ e -> setTemplateID ( ( string ) $ tmp ) ; throw $ e ; } $ render -> renderTemplate ( $ tmp , $ additionalInfo ) ; _InternalBoundModelTemplate :: $ current = NULL ; } }
Renders a subtemplate
 @param string|TemplateInterface|BoundTemplateModelInterface|array $template
 @param mixed $additionalInfo
Renders a subtemplate @param string|TemplateInterface|BoundTemplateModelInterface|array $template @param mixed $additionalInfo
/** @var TemplateControllerInterface $tc */