Hi guys
I'm trying to validate an IP address in a form:
....
$ip = new Text("ip");
$ip->setLabel("IP/Hostname");
$ip->setFilters(array('striptags', 'string'));
$ip->addValidators(array(
new IP(array(
'version' => IP::VERSION_4 | IP::VERSION_6,
'allowReserved' => false,
'allowPrivate' => false,
'message' => 'IP address has to be correct'
))
));
$this->add($ip);
.....
But I keep getting:
[Fri Jul 22 11:46:58.447250 2016] [:error] [pid 7909] [client 192.168.60.2:55810] Wrong number of parameters\n#0 [internal function]: Phalcon\Mvc\Model\Validator\Ip->validate(Object(Phalcon\Validation), 'ip')\n#1 [internal function]: Phalcon\Validation->validate(Array, Object(Hosts))\n#2 /var/www/invo/app/controllers/HostsController.php(98): Phalcon\Forms\Form->isValid(Array, Object(Hosts))\n#3 [internal function]: HostsController->createAction()\n#4 [internal function]: Phalcon\Dispatcher->dispatch()\n#5 /var/www/invo/public/index.php(32): Phalcon\Mvc\Application->handle()\n#6 {main}, referer: https://192.168.60.100/hosts/new
In the logs...
What to do??