You are here

public function Basic::selectionElement in Image Effects 8

Same name in this branch
  1. 8 src/Plugin/image_effects/FontSelector/Basic.php \Drupal\image_effects\Plugin\image_effects\FontSelector\Basic::selectionElement()
  2. 8 src/Plugin/image_effects/ImageSelector/Basic.php \Drupal\image_effects\Plugin\image_effects\ImageSelector\Basic::selectionElement()
Same name and namespace in other branches
  1. 8.3 src/Plugin/image_effects/ImageSelector/Basic.php \Drupal\image_effects\Plugin\image_effects\ImageSelector\Basic::selectionElement()
  2. 8.2 src/Plugin/image_effects/ImageSelector/Basic.php \Drupal\image_effects\Plugin\image_effects\ImageSelector\Basic::selectionElement()

Return a form element to select the plugin content.

Parameters

array $options: (Optional) An array of additional Form API keys and values.

Return value

array Render array of the form element.

Overrides ImageEffectsPluginBase::selectionElement

File

src/Plugin/image_effects/ImageSelector/Basic.php, line 25

Class

Basic
Basic image selector plugin.

Namespace

Drupal\image_effects\Plugin\image_effects\ImageSelector

Code

public function selectionElement(array $options = []) {

  // Element.
  return array_merge([
    '#type' => 'textfield',
    '#title' => $this
      ->t('Image URI/path'),
    '#description' => $this
      ->t('An URI, an absolute path, or a relative path. Relative paths will be resolved relative to the Drupal installation directory.'),
    '#element_validate' => [
      [
        $this,
        'validateSelectorUri',
      ],
    ],
  ], $options);
}