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
Post a Comment