protected function getBlocks(DataGridView $view)
    {
        if (!$this->blocks->contains($view)) {

            $templates = $this->resources;

            if (isset($this->themes[$view])) {
                $templates = array_merge($templates, $this->themes[$view]);
            }

            $blocks = array();

            foreach ($templates as $template) {
                if (!$template instanceof \Twig_Template) {
                    $template = $this->environment->loadTemplate($template);
                }
                $templateBlocks = array();
                do {
                    $templateBlocks = array_merge($template->getBlocks(), $templateBlocks);
                } while (false !== $template = $template->getParent(array()));
                $blocks = array_merge($blocks, $templateBlocks);
            }

            $this->blocks->attach($view, $blocks);
        } else {
            $blocks = $this->blocks[$view];
        }

        return $blocks;
    }
protected function getBlocks(DataGridView $view)
    {
        if (!$this->blocks->contains($view)) {

            $templates = $this->resources;

            if (isset($this->themes[$view])) {
                $templates = array_merge($templates, $this->themes[$view]);
            }

            $blocks = array();

            foreach ($templates as $template) {
                if (!$template instanceof \Twig_Template) {
                    $template = $this->environment->loadTemplate($template);
                }
                $templateBlocks = array();
                do {
                    $templateBlocks = array_merge($template->getBlocks(), $templateBlocks);
                } while (false !== $template = $template->getParent(array()));
                $blocks = array_merge($blocks, $templateBlocks);
            }

            $this->blocks->attach($view, $blocks);
        } else {
            $blocks = $this->blocks[$view];
        }

        return $blocks;
    }
protected function getBlocks ( DataGridView $ view ) { if ( ! $ this -> blocks -> contains ( $ view ) ) { $ templates = $ this -> resources ; if ( isset ( $ this -> themes [ $ view ] ) ) { $ templates = array_merge ( $ templates , $ this -> themes [ $ view ] ) ; } $ blocks = array ( ) ; foreach ( $ templates as $ template ) { if ( ! $ template instanceof \ Twig_Template ) { $ template = $ this -> environment -> loadTemplate ( $ template ) ; } $ templateBlocks = array ( ) ; do { $ templateBlocks = array_merge ( $ template -> getBlocks ( ) , $ templateBlocks ) ; } while ( false !== $ template = $ template -> getParent ( array ( ) ) ) ; $ blocks = array_merge ( $ blocks , $ templateBlocks ) ; } $ this -> blocks -> attach ( $ view , $ blocks ) ; } else { $ blocks = $ this -> blocks [ $ view ] ; } return $ blocks ; }
Returns the blocks used to render the view.

Templates are looked for in the resources in the following order:
* resources from the themes (and its parents)
* resources from the themes of parent views (up to the root view)
* default resources

@param DataGridView $view The view

@return array An array of Twig_TemplateInterface instances
Returns the blocks used to render the view .