public function SortPluginBase::buildExposeForm in Views (for Drupal 7) 8.3
Form for exposed handler options.
Overrides HandlerBase::buildExposeForm
File
- lib/
Drupal/ views/ Plugin/ views/ sort/ SortPluginBase.php, line 189 - Definition of Drupal\views\Plugin\views\sort\SortPluginBase.
Class
- SortPluginBase
- Base sort handler that has no options and performs a simple sort.
Namespace
Drupal\views\Plugin\views\sortCode
public function buildExposeForm(&$form, &$form_state) {
// #flatten will move everything from $form['expose'][$key] to $form[$key]
// prior to rendering. That's why the pre_render for it needs to run first,
// so that when the next pre_render (the one for fieldsets) runs, it gets
// the flattened data.
array_unshift($form['#pre_render'], 'views_ui_pre_render_flatten_data');
$form['expose']['#flatten'] = TRUE;
$form['expose']['label'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['label'],
'#title' => t('Label'),
'#required' => TRUE,
'#size' => 40,
'#weight' => -1,
);
}