You are here

public function FieldWidgetComponentType::getComponent in Flexiform 8

Get a component object.

Parameters

string $name: The name of the component.

array $options: The options for the component.

Return value

\Drupal\flexiform\FormComponent\FormComponentInterface The form component.

Overrides FormComponentTypeBase::getComponent

File

src/Plugin/FormComponentType/FieldWidgetComponentType.php, line 138

Class

FieldWidgetComponentType
Plugin for field widget component types.

Namespace

Drupal\flexiform\Plugin\FormComponentType

Code

public function getComponent($name, array $options = []) {
  $component = parent::getComponent($name, $options);
  if ($field_definition = $this
    ->getFieldDefinition($name)) {
    $component
      ->setFieldDefinition($this
      ->getFieldDefinition($name));
  }
  return $component;
}