[Catalyst] best practices for validation

Dave Rolsky autarch at urth.org
Wed May 16 04:28:10 GMT 2007


On Tue, 15 May 2007, mla wrote:

> o The controller should (directly or indirectly) validate
>  all the form input so you're pretty sure the model(s)
>  can handle it.

I'd just say ...

The controller should do whatever's needed to make sure data is passed 
through a validation step (this may just mean calling $model->update) and 
should make sure an validation errors are passed back to the view in a 
useful way.

> o The validation code that runs in the controller is
>  responsible for generating the end-user error messages
>  and i18n.

See above.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/



More information about the Catalyst mailing list