AttributeRequiredTrait
This is the 'required' attribute trait.
This trait has been created to share common code between form elements classes, in this case the declaration of the 'required' attribute and its set/get methods.
Tags
Table of Contents
$required | : bool | |
---|---|---|
getRequired() | This method returns the current value of the 'required' attribute. | : bool |
setRequired() | This method sets the 'required' attribute with the given value and returns self. | : self |
Properties
$required
protected
bool
$required
= false
Methods
getRequired()
This method returns the current value of the 'required' attribute.
public
getRequired() : bool
Return values
bool —setRequired()
This method sets the 'required' attribute with the given value and returns self.
public
setRequired(bool $required) : self
Parameters
- $required : bool