public function Markup::buildOptionsForm in Views XML Backend 8
Default options form that provides the label widget that all fields should have.
Overrides Standard::buildOptionsForm
File
- src/
Plugin/ views/ field/ Markup.php, line 76 - Contains \Drupal\views_xml_backend\Plugin\views\field\Markup.
Class
- Markup
- A handler to provide an XML markup field.
Namespace
Drupal\views_xml_backend\Plugin\views\fieldCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$options = [];
foreach (filter_formats($this->currentUser) as $id => $format) {
$options[$id] = $format
->get('name');
}
$form['format'] = [
'#title' => $this
->t('Format'),
'#description' => $this
->t('The filter format'),
'#type' => 'select',
'#default_value' => $this->options['format'],
'#required' => TRUE,
'#options' => $options,
];
}