2008年8月9日星期六

Re: [fw-webservices] Struggling to get zend form ini

-- andyjab <andrew@jabwebsolutions.co.uk> wrote
(on Saturday, 09 August 2008, 10:07 AM -0700):
> I am trying to transfer:
>
>
> ;$form -> setDecorators(array(
> ; 'FormElements',
> ; array('HtmlTag', array('tag' => 'table')),
> ; 'Form',
> ; ));
>
> to an ini file and have:
>
> ; Adds the table parenthesis to the form
> add.elementDecorators.formElements.decorator = "HtmlTag"
> add.elementDecorators.formElements.options.tag = "table"
>
> But this doesn't work :) Could someone please point me to perhaps an article
> that breaks this down? Or give me a hint as to what I am doing wrong?

You're using the wrong configuration key -- you're trying to set the
form decorators using a configuration key that sets element decorators.

Try this:

add.decorators.formElements.decorator = "FormElements"
add.decorators.htmlTag.decorator = "HtmlTag"
add.decorators.htmlTag.options.tag = "table"
add.decorators.form.decorator = "Form"

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: