Symfony\Bridge\Twig\Form\TwigRendererEngine::renderBlock PHP Method

renderBlock() public method

public renderBlock ( Symfony\Component\Form\FormView $view, $resource, $blockName, array $variables = [] )
$view Symfony\Component\Form\FormView
$variables array
    public function renderBlock(FormView $view, $resource, $blockName, array $variables = array())
    {
        $cacheKey = $view->vars[self::CACHE_KEY_VAR];
        $context = $this->environment->mergeGlobals($variables);
        ob_start();
        // By contract,This method can only be called after getting the resource
        // (which is passed to the method). Getting a resource for the first time
        // (with an empty cache) is guaranteed to invoke loadResourcesFromTheme(),
        // where the property $template is initialized.
        // We do not call renderBlock here to avoid too many nested level calls
        // (XDebug limits the level to 100 by default)
        $this->template->displayBlock($blockName, $context, $this->resources[$cacheKey]);
        return ob_get_clean();
    }