validators\CompareValidator $operator

$operator public property

The operator for comparison. The following operators are supported:

  • ==: check if two values are equal. The comparison is done is non-strict mode.
  • ===: check if two values are equal. The comparison is done is strict mode.
  • !=: check if two values are NOT equal. The comparison is done is non-strict mode.
  • !==: check if two values are NOT equal. The comparison is done is strict mode.
  • >: check if value being validated is greater than the value being compared with.
  • >=: check if value being validated is greater than or equal to the value being compared with.
  • <: check if value being validated is less than the value being compared with.
  • <=: check if value being validated is less than or equal to the value being compared with.

When you want to compare numbers, make sure to also set $type to number.

public string $operator = '=='
doc_Yii
2016-10-30 17:13:25
Comments
Leave a Comment

Please login to continue.