function FilterPluginBase::arrayFilterZero
Same name in other branches
- 9 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::arrayFilterZero()
- 10 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::arrayFilterZero()
- 11.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::arrayFilterZero()
Filter by no empty values, though allow the use of (string) "0".
Parameters
string $var: The variable to evaluate.
Return value
bool TRUE if the value is equal to an empty string, FALSE otherwise.
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php, line 1609
Class
- FilterPluginBase
- Base class for Views filters handler plugins.
Namespace
Drupal\views\Plugin\views\filterCode
protected static function arrayFilterZero($var) {
if (is_int($var)) {
return $var != 0;
}
return trim($var) != '';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.