Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Jakob Kirkegaard
July 22, 2004, 3:43 am
rate this thread
search for a development framework for future projects.
I stumbled upon one issue which I can't figure out how to handle most
appropriatly - namely where to put the form validation code i.e.
- in the perform() method of the specialized Action class.
- in the validate() method of the specialized Form class.
- in the set methods for the model class(es).
It is my experience that wherever I put it, I am tying things together
(e.g Actions to Models or Forms to Models) thereby prohibiting reuse of
the individual classes.
Another issue is the repopulation of a form after a failed validation -
i.e. refilling the correct values in the form. I fiddled around with
different approaches, but each time ended up tying things together that
shouldn't be ;) How should this be done respecting both the framework
and the design pattern?
regards, Jakob Kirkegaard
- » Easiest Linux distro for setting up a LAMP server?
- — Previous thread in » PHP Scripting Forum