src/AbstractRender.php
/**
     * Called from plugins that handle renderable templates.
     *
     * @param TemplateInterface $template
     * @return callable
     */
Called from plugins that handle renderable templates.
@param TemplateInterface $template
@return callable
Called from plugins that handle renderable templates . @param TemplateInterface $template @return callable
public function modifyRenderable(TemplateInterface $template): callable {
        $ctx = $this->getServiceManager()->get("renderContext");
        $bc = $ctx;
        if($boundTemplate = _InternalBoundModelTemplate::$current) {
            $realTemplate = NULL;
            (function() use (&$realTemplate){$realTemplate = $this->template;})->bindTo($boundTemplate, get_class($boundTemplate))();
            $bc = (function(){return$this->model;})->bindTo($boundTemplate, get_class($boundTemplate))();
            $template = $realTemplate;
        }
        $renderable = $template->getRenderable();
        if($template instanceof TemplateExtensionInterface || (($template instanceof ContextControlInterface) && !$template->shouldBindToContext($ctx)))
            return $renderable;
        if($renderable instanceof Closure) {
            $renderable = $renderable->bindTo($bc, get_class($bc));
        }
        return $renderable;
    }
public function modifyRenderable ( TemplateInterface $ template ) : callable { $ ctx = $ this -> getServiceManager ( ) -> get ( " renderContext " ) ; $ bc = $ ctx ; if ( $ boundTemplate = _InternalBoundModelTemplate :: $ current ) { $ realTemplate = NULL ; ( function ( ) use ( & $ realTemplate ) { $ realTemplate = $ this -> template ; } ) -> bindTo ( $ boundTemplate , get_class ( $ boundTemplate ) ) ( ) ; $ bc = ( function ( ) { return $ this -> model ; } ) -> bindTo ( $ boundTemplate , get_class ( $ boundTemplate ) ) ( ) ; $ template = $ realTemplate ; } $ renderable = $ template -> getRenderable ( ) ; if ( $ template instanceof TemplateExtensionInterface || ( ( $ template instanceof ContextControlInterface ) && ! $ template -> shouldBindToContext ( $ ctx ) ) ) return $ renderable ; if ( $ renderable instanceof Closure ) { $ renderable = $ renderable -> bindTo ( $ bc , get_class ( $ bc ) ) ; } return $ renderable ; }
Called from plugins that handle renderable templates.
Called from plugins that handle renderable templates .