I'm trying to display a summary of validation errors at the top of the form instead of next to each input.
I didn't see any built-in form helper to do this, so I decided to create a view element to do it. However, $this->Form->validationErrors
isn't a flat array of error messages, so I can't just loop through it and print out the validation errors. Here's a var_dump with just one validation error on one field:
array(1) { [0]=> &array(1) { ["terrcode"]=> array(1) { [0]=> string(30) "Please enter a territory code." } } }
So I can't loop through that without knowing the field names or flattening the array somehow. There's got to be an easier way to do this that I'm missing.