Constraint_length::applyParsley PHP Method

applyParsley() public method

public applyParsley ( )
    public function applyParsley()
    {
        parent::applyParsley();
        switch ($this->type) {
            case 'min':
                $this->field->setAttribute('data-parsley-minlength', $this->val1);
                break;
            case 'max':
                $this->field->setAttribute('data-parsley-maxlength', $this->val1);
                break;
            case 'range':
                $this->field->setAttribute('data-parsley-length', sprintf("[%s,%s]", $this->val1, $this->val2));
                break;
        }
    }