Thanks to jose_zap from IRC, I have found the solution for my issue. The solution is somewhat similar to http://book.cakephp.org/3.0/en/core-libraries/form.html In the form subclass, you need this: public function errors() { //return errors in this format: //["fieldName" => ["validatorName" => "The error message to display"]] return $this->_errors; } //You might want to use this class to pass error message public function setErrors($errors) { $this->_errors = $errors; }
In your controller actions, you would probably do something like this: $contact = new ContactForm(); $contact->setErrors(["email" => ["_required" => "Your email is required"]]); Now, you can individually invalidate any form fields from the controller, without a model and the validator class. On Wednesday, 4 March 2015 17:24:48 UTC+8, ProFire wrote: > > Hi, > > I'm relatively new to Cake3. > I have a situation where I have a modelless form that submits data to > another server for validation. When I receive the validation errors from > the server, I need to be able to invalidate the Form Inputs based on the > feedback from the server. > How do I best handle such a situation? > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.