protected function ShortcodeService::isBool in Shortcode 8
Same name and namespace in other branches
- 2.0.x src/ShortcodeService.php \Drupal\shortcode\ShortcodeService::isBool()
Helper function to decide the given param is a bool value.
Parameters
mixed $var: The variable.
Return value
bool TRUE if $var is a booleany value.
File
- src/
ShortcodeService.php, line 194
Class
- ShortcodeService
- Provide the ShortCode service.
Namespace
Drupal\shortcodeCode
protected function isBool($var) {
switch (strtolower($var)) {
case FALSE:
case 'false':
case 'no':
case '0':
$res = FALSE;
break;
default:
$res = TRUE;
break;
}
return $res;
}