[html-formfu] nested params branch

Mario Minati mario.minati at googlemail.com
Sat Nov 3 09:34:28 GMT 2007


On Saturday 03 November 2007 09:30:27 Carl Franks wrote:
> On 02/11/2007, Mario Minati <mario.minati at googlemail.com> wrote:
> > On Friday 26 October 2007 12:41:53 Carl Franks wrote:
> > > $form->param('foo.bar') would return: "xyz"
> >
> > $form->param('bar') would return undef.
> > So you always have to use the complete param name.
>
> Yup, though it shouldn't break any old code.
> I'll take a look at the docs, and ensure that's make clear.

I was thinking of using $form->param('bar') as a shortcut in cases where this 
is unique (no 'baz.bar'). 
But this makes things more complicated and through this the behaviour wouldn't 
be straight forward any longer. So I put it aside.

> I'm also planning on overloading field->name() to disallow dots and
> square brackets in names
>     .[]
> as that would really break things.
> Making it a fatal error with a clear error message would probably also
> help anyone that doesn't understand how the nested-params work, and
> tries to set the name like that.

That would be very usefull and help avoiding hard to find mistakes.

Greets,
Mario



More information about the HTML-FormFu mailing list