@param string $name
@param array  $options

@return string
482456
public function renderEvent($name, array $options = [])
    {
        $eventName = sprintf('sonata.block.event.%s', $name);

        /** @var BlockEvent $event */
        $event = $this->eventDispatcher->dispatch($eventName, new BlockEvent($options));

        $content = '';

        foreach ($event->getBlocks() as $block) {
            $content .= $this->render($block);
        }

        if ($this->stopwatch) {
            $this->traces['_events'][uniqid('', true)] = [
                'template_code' => $name,
                'event_name' => $eventName,
                'blocks' => $this->getEventBlocks($event),
                'listeners' => $this->getEventListeners($eventName),
            ];
        }

        return $content;
    }
788012
public function renderField($name, $group = '', array $options = [])
    {
        $field = $this->getField($name, $group);

        return $field->render($options);
    }
1197266
public function get($name, $options = [], $usePeeringServiceManagers = false)
    {
        if (is_string($options)) {
            $options = ['class_name' => $options];
        }

        return parent::get($name, $options, $usePeeringServiceManagers);
    }
916491
public function button($name, array $options = []) {
        $options += [
            'type' => 'button'
        ];
        $options = $this->addClass($options, 'navbar-btn');
        return $this->Form->button($name, $options);
    }
119633
private function getOption(array $options, $name, $default = null, callable $type = null)
    {
        if (array_key_exists($name, $options)) {
            $result = $options[$name];
        } else {
            $result = $default;
        }
        if ($type && !call_user_func($type, $result)) {
            throw new InvalidArgumentException(
                "The provided option for {$name}: " . print_r($result, true) . " is invalid"
            );
        }

        return $result;
    }
515734
public function selectTag($name, $optionTags, array $options = [])
    {
        # This is found also in Form::select()
        if (!is_string($optionTags)) {
            if (is_array($optionTags) && isset($optionTags[0]) && isset($optionTags[1])) {
                list ($optionTags, $value) = $optionTags;
            } else {
                $value = null;
            }
            $optionTags = $this->optionsForSelect($optionTags, $value);
        }
        
        $this->normalizeSelectOptions($options, $optionTags);
        
        return $this->formFieldTag('select', $name, $optionTags, $options, true);
    }
86215
public static function getConfig(array $options, string $name, $default = null)
    {
        $options = self::normalize($options);
        if (array_key_exists($name, $options)) {
            return $options[$name];
        }

        return $default;
    }
556448
public function get($name, array $options = array())
    {
        return $this->builder->build($name, $this->container->get('request_stack')->getCurrentRequest());
    }
121525
public function callRoute($name, array $parameters = [], array $options = [])
    {
        try {
            $content = $this->router->dispatchRoute($name, $parameters, $options);
        } catch (\Exception $e) {
            return sprintf('<p style="display:block;boder:1px solid red;" class="error">%s</p>', $e->getMessage());
        }

        return is_string($content) ? $content : '';
    }
688271
public function has($name, array $options = array())
    {
        $root = $this->builder->hasRootItemByName($name, $this->container->get('request_stack')->getCurrentRequest());

        return null !== $root;
    }
35489
private function createNode($name, $options)
    {
        $node = $name . ' [';
        foreach ($options as $key => $value) {
            $node .= $key . '=' . $value . ' ';
        }
        $node .= "]\n";

        return $node;
    }
103931
public function getOptionByName($name)
    {
        foreach ($this->options as $option) {
            if ($option->getName() == $name) {
                return $option;
            }
        }

        return false;
    }
1040197
public function choice(string $name, array $options = []): FieldTypeInterface
    {
        return (new ChoiceType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
1112298
public function tab($name, array $options = [])
    {
        if (!isset($options['label'])) {
            $options['label'] = 'form.tab_' . $name;
        }

        return parent::tab($name, $options);
    }
594018
public function getOptionalField(string $name) : string
    {
        if (isset($this->fields[$name])) {
            if ($this->fields[$name]) {
                return \array_shift($this->fields[$name]);
            }
        }

        return '';
    }
1264999
public function password($name, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::password($name, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }
759697
public function block($name, $options=[]) {

        if (!isset($this->blocks[$name])) return null;

        $options = \array_merge([
            'print' => true
        ], $options);

        $block = \implode("\n", $this->blocks[$name]);

        if ($options['print']){
            echo $block;
        }

        return $block;
    }