protected function ContainerBase::build in YAML Form 8
Build an element as text or HTML.
Parameters
string $format: Format of the element, text or html.
array $element: An element.
array|mixed $value: A value.
array $options: An array of options.
Return value
array A render array representing an element as text or HTML.
Overrides YamlFormElementBase::build
1 method overrides ContainerBase::build()
- YamlFormFlexbox::build in src/
Plugin/ YamlFormElement/ YamlFormFlexbox.php - Build an element as text or HTML.
File
- src/
Plugin/ YamlFormElement/ ContainerBase.php, line 47
Class
- ContainerBase
- Provides a base 'container' class.
Namespace
Drupal\yamlform\Plugin\YamlFormElementCode
protected function build($format, array &$element, $value, array $options = []) {
if (empty($value)) {
return [];
}
return [
'#theme' => 'yamlform_container_base_' . $format,
'#element' => $element,
'#value' => $value,
'#options' => $options,
];
}