public function onRender(ViewInterface $view, $template, array $context)
    {
        $this->assertView($view);
        
        $twig = $view->getTwig();
        
        $loader = $this->createFormulaLoader($twig);
        
        $assetManager = $this->createAssetManager($loader);
        $assetManager->setLoader('twig', $loader);   

        $tmpl = $twig->loadTemplate($template);
        
        do {
            $name = (string)$tmpl;
            $resource = $this->createResource($twig, $name);
            $assetManager->addResource($resource, 'twig');
        } while ($tmpl = $tmpl->getParent($context));
        
        $this->writer->writeManagerAssets($assetManager);
    }
public function onRender(ViewInterface $view, $template, array $context)
    {
        $this->assertView($view);
        
        $twig = $view->getTwig();
        
        $loader = $this->createFormulaLoader($twig);
        
        $assetManager = $this->createAssetManager($loader);
        $assetManager->setLoader('twig', $loader);   

        $tmpl = $twig->loadTemplate($template);
        
        do {
            $name = (string)$tmpl;
            $resource = $this->createResource($twig, $name);
            $assetManager->addResource($resource, 'twig');
        } while ($tmpl = $tmpl->getParent($context));
        
        $this->writer->writeManagerAssets($assetManager);
    }
public function onRender ( ViewInterface $ view , $ template , array $ context ) { $ this -> assertView ( $ view ) ; $ twig = $ view -> getTwig ( ) ; $ loader = $ this -> createFormulaLoader ( $ twig ) ; $ assetManager = $ this -> createAssetManager ( $ loader ) ; $ assetManager -> setLoader ( 'twig' , $ loader ) ; $ tmpl = $ twig -> loadTemplate ( $ template ) ; do { $ name = ( string ) $ tmpl ; $ resource = $ this -> createResource ( $ twig , $ name ) ; $ assetManager -> addResource ( $ resource , 'twig' ) ; } while ( $ tmpl = $ tmpl -> getParent ( $ context ) ) ; $ this -> writer -> writeManagerAssets ( $ assetManager ) ; }
Called when view renders a template.

@param ViewInterface $view
@param string        $template   Template filename
@param array         $context
Called when view renders a template .