public function VeflTrait::buildOptionsForm in Views exposed form layout 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/views/exposed_form/VeflTrait.php \Drupal\vefl\Plugin\views\exposed_form\VeflTrait::buildOptionsForm()
File
- src/
Plugin/ views/ exposed_form/ VeflTrait.php, line 30
Class
- VeflTrait
- Trait for vefl.
Namespace
Drupal\vefl\Plugin\views\exposed_formCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$layout_id = $this->options['layout']['layout_id'];
$layouts = $this->vefl
->getLayouts();
// Outputs layout selectbox.
$form['layout'] = [
'#type' => 'details',
'#title' => $this
->t('Layout settings'),
];
$form['layout']['layout_id'] = [
'#prefix' => '<div class="container-inline">',
'#type' => 'select',
'#options' => $this->vefl
->getLayoutOptions($layouts),
'#title' => $this
->t('Layout'),
'#default_value' => $layout_id,
];
$form['layout']['change'] = [
'#type' => 'submit',
'#value' => $this
->t('Change'),
'#submit' => [
[
$this,
'updateRegions',
],
],
'#suffix' => '</div>',
];
$form['layout']['widget_region'] = $this
->getRegionElements($layout_id, $layouts);
}