The use of validation in the model returns a 503 error
Delete the validator can run
why?
in phalcon3.01, php7
model code:
<?php
namespace Frontend\Models;
use Phalcon\Validation,
Phalcon\Validation\Validator\Uniqueness;
class Spider extends ModelBase
{
public function validation()
{
$validator = new Validation();
$validator->validate(
"surl",
new Uniqueness()
);
return $this->validate($validator);
}
}
mysql table:
CREATE TABLE `spider` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`s` varchar(200) NOT NULL DEFAULT ''',
`surl` varchar(250) NOT NULL DEFAULT ''',
`stitle` varchar(250) NOT NULL DEFAULT '',
`saddtime` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;