getParams(); if (empty($param) || !isset($param[$this->field])) { return $this->addError(':attribute not exists'); } $value = $param[$this->field]; switch (strtolower($this->method)) { case self::CAN_NOT_EMPTY: if (strlen($value) < 1) { return $this->addError('The :attribute can not empty.'); } break; case self::CAN_NOT_NULL: if ($value === null) { return $this->addError('The :attribute can not is null.'); } break; } return true; } }