If the site is running on a local server, then the validation is normal. But if we run nginx + apache, professionally configured on the web server, the validator returns false if we pass the values' user_id = 12, or any other

PHP version is the same.

['user_id', 'string', 'length' => [1, 15]], 

Why?

  • Why do you use length for int? Check what comes in the model. - ilyaplot pm
  • @ilyaplot, the validator treats 12 as the same string. - user207618
  • Of course, it transforms. - ilyaplot
  • @ilyaplot It doesn't matter, in my opinion. And even if you pass a string value, it will still not be validated by the web server, but by an openserver (local web server), it will be. - gilo1212
  • It is not clear how the value is transmitted, whether it comes to the model, does the script work, which versions of php locally and on the server? - ilyaplot 1:21 pm

0