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\NumberValidator $integerOnly

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

validators\NumberValidator $integerPattern

$integerPattern public property The regular expression for matching integers. public string $integerPattern = '/^\s*[+-]?\d+\s*$/'

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 validateIPv4()

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

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 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 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 $subnet

$subnet public property Whether the address can be an IP with CIDR subnet, like 192.168.10.0/24. The following values are possible: false - the address must not have a subnet (default). true - specifying a subnet is required. null - specifying a subnet is optional. public boolean $subnet = false