php - custom validator in symfony -
php - custom validator in symfony -
i create custom validator symfony 1.4, illustration check length name. know exist, own.
i create /myapp/lib/validator/sfvalidatorname.class.php
must there:
class sfvalidatorname extends sfvalidatorbase { protected function configure($options = array(), $messages = array()) { $this->addmessage('invalid', 'invalid name!'); } protected function doclean($value) { } }
and how can add together function, example:
if (count($letters) < 3) { homecoming 'too small'; } else if (count($letters) > 43) { homecoming 'too long'; }
open /lib/validator/sfvalidatorstring.class.php model validator after one.
php symfony1 validation symfony-1.4
Comments
Post a Comment