validators\NumberValidator $integerOnly

$integerOnly public property Whether the attribute value can only be an integer. Defaults to false. public boolean $integerOnly = false

validators\IpValidator validateValue()

validateValue() protected method Validates a value. A validator class can implement this method to support data validation out of the context of a data model. protected array|null validateValue ( $value )$value mixed The data value to be validated. return array|null The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid. throws yii\base\NotSupportedException if the validator does not supporting data validation withou

validators\IpValidator validateIPv6()

validateIPv6() protected method Validates IPv6 address protected boolean validateIPv6 ( $value )$value string

validators\IpValidator validateIPv4()

validateIPv4() protected method Validates IPv4 address protected boolean validateIPv4 ( $value )$value string

validators\IpValidator validateAttribute()

validateAttribute() public method Validates a single attribute. Child classes must implement this method to provide the actual validation logic. public void validateAttribute ( $model, $attribute )$model yii\base\Model The data model to be validated $attribute string The name of the attribute to be validated.

validators\IpValidator setRanges()

setRanges() public method Set the IPv4 or IPv6 ranges that are allowed or forbidden. The following preparation tasks are performed: Recursively substitutes aliases (described in $networks) with their values. Removes duplicates public void setRanges ( $ranges )$ranges array The IPv4 or IPv6 ranges that are allowed or forbidden. When the array is empty, or the option not set, all IP addresses are allowed. Otherwise, the rules are checked sequentially until the first match is found. An IP a

validators\IpValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

validators\IpValidator getRanges()

getRanges() public method public array getRanges ( )return array The IPv4 or IPv6 ranges that are allowed or forbidden.

validators\IpValidator clientValidateAttribute()

clientValidateAttribute() public method Returns the JavaScript needed for performing client-side validation. You may override this method to return the JavaScript validation code if the validator can support client-side validation. The following JavaScript variables are predefined and can be used in the validation code: attribute: an object describing the the attribute being validated. value: the value being validated. messages: an array used to hold the validation error messages for the

validators\IpValidator $wrongCidr

$wrongCidr public property User-defined error message is used when validation fails due to the wrong CIDR. You may use the following placeholders in the message: {attribute}: the label of the attribute being validated {value}: the value of the attribute being validated See also $subnet. public string $wrongCidr = null