Hi Benjamin, Thanks a lot for your input!
What is the use case for using this DataBinder separately? The Form basically _is_ the DataBinder. Value transformation (that you describe using converters) and property reading/binding is all a form does (apart from describing its own structure). I'm not sure whether it's reasonably possible to separate the DataBinder logic from the Form and Field classes, but please convince me of the opposite :) Cheers, Bernhard -- Software Architect & Engineer Blog: http://webmozarts.com Twitter: http://twitter.com/webmozart 2010/10/23 benjamin.dulau <[email protected]>: > Hi, > > I'm actually a Zend Framework user, but am also an architect and i > spend lot of time adding bricks that doesn't exist (yet) into PHP > frameworks. > > Now, i'm very interested about the Symfony 2 features which are the > ones i have expected for a long time. My choice had gone to Zend > Framework because of it's flexibility and i knew i could override all > i want. > > But now, the early preview of Symfony 2 has showed up, and all the > stuff are very promising. > > My interest goes especially to Forms features, but i have some > concerns about it, and some questions :) > > Why didn't you separate binding logic from the Form object and > dedicated a component to it ? > > I had a dream :) > In that dream, i have a databinder which could be used with or without > a form object. > > That kind of stuff : http://pastie.org/1242794 > > That's a use case I proposed for Zend, but the idea is the same. > > But, also, wouldn't be great if the binder would instanciate > automatically models while walking through the property path, by using > docblocks and more advanced reflection ? > > Because that kind of code is nice : > > # src/Application/HelloBundle/Controller/HelloController.php > public function signupAction() > { > $customer = new Customer(); > $customer->address = new Address(); > > // form configuration ... > > $group = new FieldGroup('address'); > $group->add(new TextField('street')); > $group->add(new TextField('zipCode')); > $form->add($group); > > // process form ... > } > > But what if i have a collection, or several nested objects levels ? I > can't instanciate each one by myself. > > Well, i know that i'm coming from nowhere, but i follow the project > with great interest :) > > Hope my english is well enough, thanks ! > > br, > Benjamin > > -- > 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 > -- 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
