Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     $view->setRendered();
 }
Esempio n. 2
0
    protected function renderSection(FormView $view, $section, array $variables = array())
    {
        $template = null;
        $blocks = $view->get('types');

        foreach ($blocks as &$block) {
            $block = $block.'_'.$section;
            $template = $this->lookupTemplate($block);

            if ($template) {
                break;
            }
        }

        if (!$template) {
            throw new FormException(sprintf('Unable to render form as none of the following blocks exist: "%s".', implode('", "', $blocks)));
        }

        if ('widget' === $section || 'row' === $section) {
            $view->setRendered();
        }

        return $this->render($template, array_merge($view->all(), $variables));
    }