Skip to content

Commit

Permalink
[Twig] made a small optimization to avoid problems with XDebug when r…
Browse files Browse the repository at this point in the history
…endering forms with deep nested collections
  • Loading branch information
fabpot committed Jul 16, 2011
1 parent e3a14c8 commit 634131b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Bridge/Twig/Extension/FormExtension.php
Expand Up @@ -248,7 +248,10 @@ protected function render(FormView $view, $section, array $variables = array())


$this->varStack[$rendering]['typeIndex'] = $typeIndex; $this->varStack[$rendering]['typeIndex'] = $typeIndex;


$html = $this->template->renderBlock($types[$typeIndex], $this->varStack[$rendering]['variables'], $blocks); // we do not call renderBlock here to avoid too many nested level calls (XDebug limits the level to 100 by default)
ob_start();
$this->template->displayBlock($types[$typeIndex], $this->varStack[$rendering]['variables'], $blocks);
$html = ob_get_clean();


if ($mainTemplate) { if ($mainTemplate) {
$view->setRendered(); $view->setRendered();
Expand Down

0 comments on commit 634131b

Please sign in to comment.