You are here

public function Dropdown::validatePath in Image Effects 8

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

Validation handler for the 'path' element.

File

src/Plugin/image_effects/FontSelector/Dropdown.php, line 48

Class

Dropdown
Dropdown font selector plugin.

Namespace

Drupal\image_effects\Plugin\image_effects\FontSelector

Code

public function validatePath($element, FormStateInterface $form_state, $form) {
  if (!is_dir($element['#value'])) {
    $form_state
      ->setErrorByName(implode('][', $element['#parents']), $this
      ->t('Invalid directory specified.'));
  }
}