Do I have any errors in my form?

A nice little trick to check if you have some errors in the view is to use the $session object.

Try this (in the view): pr($this->validationErrors) or pr($session->validationErrors), be sure to actually have some errors in the form…

I leave it up to you to come with some nice usage for it.

Well, here’s a little hint: try creating an element that will check if the above array is empty or set, and if so display some generic message, such as “Please fix the errors below…” this is especially useful for long HTML forms where the actual error message (or field error)¬†might fall below the screen fold.

%d bloggers like this: