But dosent the form class itself dependt on a validator object when constructing?
On Nov 3, 7:21 pm, Benjamin Eberlei <[email protected]> wrote: > Its just not feasible from a programmatic perspective. The validation > component is supposed to be decoupled from the form. You should be able > to validate your models without a form instance (think webservice, cli, > tasks, ...). > > So where would the validation then be if not on the value of the model > itself? If it would be in an array "again", then the whole concept of > the new form/validation framework would break into pieces. > > new paradigm: Its the object that is getting validated, with its values! > not the form. ;) > > greetings, > Benjamin > > > > > > > > On Wed, 2010-11-03 at 10:18 -0700, Henrik Bjornskov wrote: > > +1 > > > Validation should be performed before setting the data on a object and > > if the validation does not pass it should not be set at all. > > > On Nov 3, 2:21 pm, Lukas Kahwe Smith <[email protected]> wrote: > > > On 03.11.2010, at 13:12, Bernhard Schussek wrote: > > > > > I agree that it would be magnific if we could constrain method > > > > parameters. But to automate this would require AOP, which is not > > > > supported by PHP. So the only other reasonable approach IMO is to > > > > validate data that is already written into the object, by validating > > > > property/getter values. > > > > > Pulling the validation definition completely out of the objects and > > > > into the form would be a step backwards now. > > > > but you set the values in the entity. why can't you validate the data > > > just before you set it? > > > > > @Lukas: Your use cases can be solved differently. Aside from the > > > > object also the form field is validated. You could f.i. constrain > > > > getDisplayedData(), which contains exactly what the user has entered > > > > into the field. > > > > hmm not sure what you mean here exactly. how/what should i be > > > constraining? also note in the entity i dont have access to the form > > > anymore. > > > > regards, > > > Lukas Kahwe Smith > > > [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
