php - Terminate after single validation error - Cakephp 3 -


i know somewhere in documentation, can't find it. how can output 1 validation error @ time instead of aggregating on every possible validation , output in $entity->errors()? in addition that, there simple way give setting every validation in every table?

edit

i found answer first question following:

$validator ->add('body', [     'minlength' => [         'rule' => ['minlength', 10],         'last' => true, // particular line         'message' => 'comments must have substantial body.'     ],     'maxlength' => [         'rule' => ['maxlength', 250],         'message' => 'comments cannot long.'     ] ]); 

again, there way apply validation methods, everywhere?


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -