use Phalcon\Validation\Validator\Regex;
$contactNo = new Text('contactno');
$contactNo->setLabel('Vendor Contact Number');
$contactNo->addValidator(array(
new Regex(array(
'pattern' => '/^[789]\d{9}$/',
'message' => 'The Contact Number is not valid'
))
));
$this->add($contactNo);
What is wrong in this code?
It's giving me error as "The validators parameter must be an object"