protected function getBlocks(\Twig_Template $template, $parameters = []) { $blocks = []; if (false !== ($parent = $template->getParent($parameters))) { $blocks = $this->getBlocks($parent); } return array_merge($blocks, $template->getBlocks()); }