Does this Inputfield have the given class name (or names)?
Example
if($inputfield->hasClass('foo')) {
// This Inputfield has a class attribute with "foo"
}
if($inputfield->hasClass('bar', 'wrapClass')) {
// This .Inputfield wrapper has a class attribute with "bar"
}
if($inputfield->hasClass('foo bar')) {
// This Inputfield has both "foo" and "bar" classes (Since 3.0.16)
}
Usage
// basic usage
$bool = $inputfield->hasClass($class);
// usage with all arguments
$bool = $inputfield->hasClass($class, string $property = 'class');
Arguments
Name | Type(s) | Description |
---|---|---|
class | string, array | Specify class name or one of the following:
|
property (optional) | string | Optionally specify property you want to pull class from:
|
Return value
bool
See Also
Inputfield methods and properties
API reference based on ProcessWire core version 3.0.236