(on Wednesday, 27 August 2008, 04:29 PM +0200):
> On Wed, Aug 27, 2008 at 16:23, Matthew Weier O'Phinney <matthew@zend.com> wrote:
> >
> > -- Paweł Chuchmała <pawel.chuchmala@gmail.com> wrote
> >
> > > Problem is that Zend_Form_Element call filterName with 'allowBrackets' = flase.
> > > Why?
> > > For Zend_Form_Element_Multicheckbox brackets are allowed, so why not for all
> > > elements?
> >
> > Set the "isArray" property of the element:
> >
> > $element->setIsArray(true);
> >
> > This will append [] to the name.
>
> Ok, but if i want not only name[], but: name[12], name[43] ?
Won't work with Zend_Form.
You *could* put them in a subform, which would automatically create the
namespacing... but using numbers for element names within Zend_Form is a
no-no (element names need to be valid variable names, and variable names
cannot begin with numbers).
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论