src/Plugin/RenderTemplateDefaultDispatchPlugin.php
/**
     * This method is called for templates that know about their extensions.
     *
     * @param ExtendableAwareTemplateInterface $template
     */
This method is called for templates that know about their extensions.
This method is called for templates that know about their extensions .
protected function loadExtensionAwareTemplate(ExtendableAwareTemplateInterface $template) {
        $render = AbstractRender::getCurrentRender();
        $tc = $render->getTemplateController();
        foreach($template->getRequiredExtensionIdentifiers() as $reuse => $identifier) {
            $tmp = $tc->getTemplate($identifier);
            if(!$tmp) {
                $e = new TemplateNotFoundException("Template $identifier not found");
                $e->setRender($render);
                $e->setTemplateID($identifier);
                throw $e;
            }
            if($tmp instanceof TemplateExtensionInterface)
                $template->registerExtension($tmp, is_string($reuse) ? $reuse : NULL);
            else {
                trigger_error(sprintf("Template %s (%s) does not implement %s", $tmp->getName(), $tmp->getID(), TemplateExtensionInterface::class), E_USER_WARNING);
            }
        }
        foreach($template->getOptionalExtensionIdentifiers() as $reuse => $identifier) {
            $tmp = $tc->getTemplate($identifier);
            if($tmp) {
                if($tmp instanceof TemplateExtensionInterface)
                    $template->registerExtension($tmp, is_string($reuse) ? $reuse : NULL);
                else {
                    trigger_error(sprintf("Template %s (%s) does not implement %s", $tmp->getName(), $tmp->getID(), TemplateExtensionInterface::class), E_USER_WARNING);
                }
            }
        }
    }
protected function loadExtensionAwareTemplate ( ExtendableAwareTemplateInterface $ template ) { $ render = AbstractRender :: getCurrentRender ( ) ; $ tc = $ render -> getTemplateController ( ) ; foreach ( $ template -> getRequiredExtensionIdentifiers ( ) as $ reuse => $ identifier ) { $ tmp = $ tc -> getTemplate ( $ identifier ) ; if ( ! $ tmp ) { $ e = new TemplateNotFoundException ( " Template  $ identifier  not found " ) ; $ e -> setRender ( $ render ) ; $ e -> setTemplateID ( $ identifier ) ; throw $ e ; } if ( $ tmp instanceof TemplateExtensionInterface ) $ template -> registerExtension ( $ tmp , is_string ( $ reuse ) ? $ reuse : NULL ) ; else { trigger_error ( sprintf ( " Template %s (%s) does not implement %s " , $ tmp -> getName ( ) , $ tmp -> getID ( ) , TemplateExtensionInterface :: class ) , E_USER_WARNING ) ; } } foreach ( $ template -> getOptionalExtensionIdentifiers ( ) as $ reuse => $ identifier ) { $ tmp = $ tc -> getTemplate ( $ identifier ) ; if ( $ tmp ) { if ( $ tmp instanceof TemplateExtensionInterface ) $ template -> registerExtension ( $ tmp , is_string ( $ reuse ) ? $ reuse : NULL ) ; else { trigger_error ( sprintf ( " Template %s (%s) does not implement %s " , $ tmp -> getName ( ) , $ tmp -> getID ( ) , TemplateExtensionInterface :: class ) , E_USER_WARNING ) ; } } } }
This method is called for templates that know about their extensions.
This method is called for templates that know about their extensions .