protected function addRequiredAttribute($rules)
    {
        if (!in_array('required', $rules)) {
            return;
        }

        if ($this instanceof Form\Field\MultipleFile
            || $this instanceof Form\Field\File) {
            return;
        }

        $this->required();
    }
protected function addRequiredAttribute($rules)
    {
        if (!in_array('required', $rules)) {
            return;
        }

        if ($this instanceof Form\Field\MultipleFile
            || $this instanceof Form\Field\File) {
            return;
        }

        $this->required();
    }
protected function addRequiredAttribute ( $ rules ) { if ( ! in_array ( 'required' , $ rules ) ) { return ; } if ( $ this instanceof Form \ Field \ MultipleFile || $ this instanceof Form \ Field \ File ) { return ; } $ this -> required ( ) ; }
Add `required` attribute to current field if has required rule,
except file and image fields.

@param array $rules
Add required attribute to current field if has required rule except file and image fields .