David,

Thanks for your reply. The getDynamicValues is just a small proxy method,
devs are free to redirect to an external function. But I think your idea is
better and match my futur needs, I want to include an event type parameter,
so methods names will be  :

   - handle*OnClick*CliendId or handle*OnUpdate*ClientId
   - clientId_*OnClick* or clientId_*OnUpdate*

The later can be better as methods can be ordered by field names. Not sure
what is the best solution. Any suggestions ?

On Tue, Feb 24, 2009 at 10:19 AM, David Herrmann <[email protected]> wrote:

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


-- 
Thomas Rabaix

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to