public function EmbedCode::validate in Lightning Media 8.2
Same name and namespace in other branches
- 8.4 src/Plugin/EntityBrowser/Widget/EmbedCode.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EmbedCode::validate()
- 8 src/Plugin/EntityBrowser/Widget/EmbedCode.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EmbedCode::validate()
- 8.3 src/Plugin/EntityBrowser/Widget/EmbedCode.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EmbedCode::validate()
Overrides EntityFormProxy::validate
File
- src/
Plugin/ EntityBrowser/ Widget/ EmbedCode.php, line 68
Class
- EmbedCode
- An Entity Browser widget for creating media entities from embed codes.
Namespace
Drupal\lightning_media\Plugin\EntityBrowser\WidgetCode
public function validate(array &$form, FormStateInterface $form_state) {
$value = trim($this
->getInputValue($form_state));
if ($value) {
parent::validate($form, $form_state);
}
else {
$form_state
->setError($form['widget'], $this
->t('You must enter a URL or embed code.'));
}
}