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

validators\IpValidator $ranges

$ranges public property 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 address is forbidden, when it has not matched any of the rules. Example: [ 'ranges' => [ '192.168.10.128' '!192.168.10.0/24', 'any' // allows any other IP addresses ] ] In this example, access is allowed for all t

validators\IpValidator $notInRange

$notInRange public property User-defined error message is used when validation fails due to IP address is not not allowed by $ranges check. 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 $ranges. public string $notInRange = null

validators\IpValidator $noSubnet

$noSubnet public property User-defined error message is used when validation fails due to subnet $subnet set to 'only', but the CIDR prefix is not set. 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 $noSubnet = null

validators\IpValidator $normalize

$normalize public property Whether to add the CIDR prefix with the smallest length (32 for IPv4 and 128 for IPv6) to an address without it. Works only when subnet is not false. For example: 10.0.1.5 will normalized to 10.0.1.5/32 2008:db0::1 will be normalized to 2008:db0::1/128 Defaults to false. See also $subnet. public boolean $normalize = false

validators\IpValidator $networks

$networks public property The network aliases, that can be used in $ranges. key - alias name value - array of strings. String can be an IP range, IP address or another alias. String can be negated with NEGATION_CHAR (independent of negation option). The following aliases are defined by default: *: any any: 0.0.0.0/0, ::/0 private: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fd00::/8 multicast: 224.0.0.0/4, ff00::/8 linklocal: 169.254.0.0/16, fe80::/10 localhost: 127.0.0.0/8', ::1

validators\IpValidator $negation

$negation public property Whether address may have a NEGATION_CHAR character at the beginning. Defaults to false. public boolean $negation = false

validators\IpValidator $message

$message public property User-defined error message is used when validation fails due to the wrong IP address format. 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 public string $message = null

validators\IpValidator $ipv6Pattern

$ipv6Pattern public property Regexp-pattern to validate IPv6 address public string $ipv6Pattern = '/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-

validators\IpValidator $ipv6NotAllowed

$ipv6NotAllowed public property User-defined error message is used when validation fails due to the disabled IPv6 validation. 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 $ipv6. public string $ipv6NotAllowed = null