I know this has been mentioned before (and sorry if not completely
applicible) but decoupling the initialization of the form from the
_construct works for me, it gives some breathing space:

$form = new SomeForm($foo, $bar);
$form->setSomeArbitrayMethodCall();
$form->setOption('foo', 'bar');
$form->init(); // form ready for use

or

$form = $this->get('myproject.form.myform');
$form->setArbitaryEntity($myEntity);
$form->init();

I think this solves some of the issues of #1 and #3 no?

I prefer option #1 as the most readable, option #2 looks over complicated to me.

On 8 February 2011 14:19, Bernhard Schussek <[email protected]> wrote:
> Hi Kris,
>
> Unfortunately this approach doesn't really solve our problem, because
> we still rely on a base class to fill the options (and any code
> executed before won't have access to them, unless you pass and process
> the $options array manually).
>
> If there are no other concerns about #2 (or better suggestions), I
> will implement this solution tomorrow.
>
> 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
>



-- 
Dan Leech

Web Developer
www.dantleech.com

-- 
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

Reply via email to