function FilterPluginBase::operatorForm
Same name in other branches
- 9 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::operatorForm()
- 8.9.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::operatorForm()
- 11.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::operatorForm()
Options form subform for setting the operator.
This may be overridden by child classes, and it must define $form['operator'];
See also
buildOptionsForm()
3 calls to FilterPluginBase::operatorForm()
- FilterPluginBase::buildExposedFiltersGroupForm in core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php - Build the form to let users create the group of exposed filters.
- FilterPluginBase::buildExposedForm in core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php - Render our chunk of the exposed filter form when selecting.
- FilterPluginBase::showOperatorForm in core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php - Shortcut to display the operator form.
6 methods override FilterPluginBase::operatorForm()
- Access::operatorForm in core/
modules/ node/ src/ Plugin/ views/ filter/ Access.php - Options form subform for setting the operator.
- LatestRevision::operatorForm in core/
modules/ views/ src/ Plugin/ views/ filter/ LatestRevision.php - Options form subform for setting the operator.
- LatestTranslationAffectedRevision::operatorForm in core/
modules/ views/ src/ Plugin/ views/ filter/ LatestTranslationAffectedRevision.php - Options form subform for setting the operator.
- Search::operatorForm in core/
modules/ search/ src/ Plugin/ views/ filter/ Search.php - Options form subform for setting the operator.
- Status::operatorForm in core/
modules/ media/ src/ Plugin/ views/ filter/ Status.php - Options form subform for setting the operator.
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php, line 328
Class
- FilterPluginBase
- Base class for Views filters handler plugins.
Namespace
Drupal\views\Plugin\views\filterCode
protected function operatorForm(&$form, FormStateInterface $form_state) {
$options = $this->operatorOptions();
if (!empty($options)) {
$form['operator'] = [
'#type' => count($options) < 10 ? 'radios' : 'select',
'#title' => $this->t('Operator'),
'#default_value' => $this->operator,
'#options' => $options,
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.