modify plugin name
This commit is contained in:
+7
-5
@@ -23,11 +23,13 @@ class RoundValidator extends BaseValidator
|
||||
*/
|
||||
public function trigger(): bool
|
||||
{
|
||||
$value = $this->model->getAttribute($this->field);
|
||||
if ($value == null || round($value, $this->value) != $value) {
|
||||
return $this->addError('The param :attribute length error');
|
||||
}
|
||||
return true;
|
||||
return $this->_validator($this->field, function ($field, $model, $param) {
|
||||
$value = $model->getAttribute($field);
|
||||
if ($value == null || round($value, $param) != $value) {
|
||||
return $this->addError('The param :attribute length error');
|
||||
}
|
||||
return true;
|
||||
}, $this->model, $this->value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user