Hi Thomas,

Thomas Rabaix wrote:
> Yesterday night I published a interesting post about "how to add more 
> dynamism to your sfForm". feel free to :
>     * send me comments so future improvements can match the community needs

Thanks for this interesting piece of work!

I think that as a proof of concept it's really great, although I 
personally dislike huge array constructions as seen in your demo 
getDynamicValues() function - there's just a bit too much magic and too 
little understanding for me in there.

Another thing is that on a bigger sized form the getDynamicValues method 
might easily become very large and unreadable - perhaps instead of this:

public function getDynamicValues($widgetSchema, $field)
{
   if($field == 'client_id')
   {
   }
   if($field == 'whatever')
   {
   }
}

it would be better to have several methods like this:

public function getDynamicValuesForClientId($widgetSchema)
{
}
public function getDynamicValuesForWhatever($widgetSchema)
{
}

As far as I see it, these methods wouldn't share any code, so separating 
them seems more clean to me in the first place and manipulating them 
separately would reduce the risk of accidently damaging something that 
is working fine. And after all sparing an unneeded indentation level is 
always a good thing!

Looking forward to seeing more about this,

David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to