Raul Leaño Martinet
Raul Leaño Martinet

Reputation: 2113

cakephp form validation

does anyone know if there is a VALIDATE function for a form in cakePHP and view the errors array? i.ve checked the documentation but the only thing i found is the SAVE function, i just need to know if the data i send is valid and review the errors manually.

Upvotes: 2

Views: 4531

Answers (1)

Nik Chankov
Nik Chankov

Reputation: 6047

Try this

$this->ModelName->set( $this->data );

if ($this->ModelName->validates()) {
  // it validated logic
} else {
  // didn't validate logic
}

And read this

Upvotes: 6

Related Questions