变更
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ class LengthValidator extends BaseValidator
|
|||||||
*/
|
*/
|
||||||
public function trigger(): bool
|
public function trigger(): bool
|
||||||
{
|
{
|
||||||
return $this->_validator($this->field, function ($field, $params, $method, $value) {
|
return $this->_validator($this->field, function ($field, $params, $method, $length) {
|
||||||
$value = $params[$this->field] ?? null;
|
$value = $params[$field] ?? null;
|
||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
if ($method != self::MAX_LENGTH) {
|
if ($method != self::MAX_LENGTH) {
|
||||||
return $this->addError($field, 'The param :attribute not exists');
|
return $this->addError($field, 'The param :attribute not exists');
|
||||||
|
|||||||
Reference in New Issue
Block a user