Yep, #2. I don't like the static calls, but if it's truly a utility class then it seems pragmatic.
For unsupported options, could we pass the options array by reference and have the Option class unset each entry? By the end of setting the options, we'd have an array of "extra" options. One way or another, I think #2 could still complain about unsupported options (perhaps with a touch of manual work in each field). @weaverryan On Feb 6, 2011 9:10 AM, "Benjamin Eberlei" <[email protected]> wrote: > i like 2, its very explicit to write and read and will greatly help the code readibilty and people to debug their forms if necessary. > > On Sun, 6 Feb 2011 18:02:49 +0100 > Bernhard Schussek <[email protected]> wrote: > >> Hi fellow Symfony2 enthusiasts, >> >> >> I've been scratching my head now for months trying to fix the option >> implementation in the Form framework. Currently we still have the >> implementation of Symfony1 which has several issues. I've summarized >> the current approach and the alternatives in a couple of Gists. >> >> #1: The current way, using addOption(), addRequiredOption() and getOption() >> https://gist.github.com/807833 >> >> #2: Using a static Options class with utility functions >> https://gist.github.com/807810 >> >> #3: Using a static OptionSupport class that automatically writes >> options into properties >> https://gist.github.com/807818 >> >> To me, #2 looks like the only sane solution. The other solutions lead >> to weird and hard-to-debug problems and I don't want to cause people >> hurting their brains. >> >> Please give me some input. I want to fix this ASAP. >> >> >> Bernhard >> -- >> Software Architect & Engineer >> Blog: http://webmozarts.com >> Twitter: http://twitter.com/webmozart >> >> -- >> 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 -- 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
