CakePHP 3 in debug mode:
When submitting a form, I would like to add an error for an input in Controller. As it does the validation in the Table.
In the controller function I have tried to assign the error:
$user['errors'] = ['password2' => array('text' => 'Custom text')];
But it creates a new array in the model $user
, and it does not insert the error.
In addition, I would like to focus the cursor to the input with the error, so it is clear to the user which field is falling.