You are here

protected function FieldWidgetComponent::getRenderer in Flexiform 8

Get the renderer.

Return value

\Drupal\Core\Field\PluginSettingsInterface The plugin settings.

5 calls to FieldWidgetComponent::getRenderer()
FieldWidgetComponent::extractFormValues in src/Plugin/FormComponentType/FieldWidgetComponent.php
Extract the form values.
FieldWidgetComponent::render in src/Plugin/FormComponentType/FieldWidgetComponent.php
Render the component in the form.
FieldWidgetComponent::settingsForm in src/Plugin/FormComponentType/FieldWidgetComponent.php
Get the settings form.
FieldWidgetComponent::settingsSummary in src/Plugin/FormComponentType/FieldWidgetComponent.php
Get the settings summary.
FieldWidgetComponent::thirdPartySettingsForm in src/Plugin/FormComponentType/FieldWidgetComponent.php

File

src/Plugin/FormComponentType/FieldWidgetComponent.php, line 84

Class

FieldWidgetComponent
Component class for field widgets.

Namespace

Drupal\flexiform\Plugin\FormComponentType

Code

protected function getRenderer() {
  if (!empty($this->renderer)) {
    return $this->renderer;
  }

  // Instantiate a widget object for the display properties.
  if (isset($this->options['type']) && ($definition = $this
    ->getFieldDefinition())) {
    $widget = $this->pluginManager
      ->getInstance([
      'field_definition' => $definition,
      'form_mode' => $this
        ->getFormDisplay()
        ->getOriginalMode(),
      'prepare' => FALSE,
      'configuration' => $this->options,
    ]);
  }
  else {
    $widget = NULL;
  }
  $this->renderer = $widget;
  return $widget;
}