Zend_Form, remove / add decorator for all elements of a form

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend_Form, remove / add decorator for all elements of a form

waigani-2
Is there a way to add and remove a decorator for all the elements of a form, not one at a time?

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Form, remove / add decorator for all elements of a form

weierophinney
Administrator
-- Waigani <[hidden email]> wrote
(on Tuesday, 29 April 2008, 12:40 AM -0700):
> Is there a way to add and remove a decorator for all the elements of a
> form, not one at a time?

No. You have to loop through the elements and sub forms to do this.

However... you could also call setElementDecorators() with a revised
list of decorators, which would achieve something similar.

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend - The PHP Company   | http://www.zend.com/
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Form, remove / add decorator for all elements of a form

waigani-2
thanks, can you change the type of an element after it has been added?

Matthew Weier O'Phinney-3 wrote
-- Waigani <jesse.meek@otago.ac.nz> wrote
(on Tuesday, 29 April 2008, 12:40 AM -0700):
> Is there a way to add and remove a decorator for all the elements of a
> form, not one at a time?

No. You have to loop through the elements and sub forms to do this.

However... you could also call setElementDecorators() with a revised
list of decorators, which would achieve something similar.

--
Matthew Weier O'Phinney
Software Architect       | matthew@zend.com
Zend - The PHP Company   | http://www.zend.com/
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Form, remove / add decorator for all elements of a form

weierophinney
Administrator
-- Waigani <[hidden email]> wrote
(on Tuesday, 29 April 2008, 03:30 PM -0700):
> thanks, can you change the type of an element after it has been added?

No, but you can call addElement() with a new element of the same name,
and it will overwrite it.


> Matthew Weier O'Phinney-3 wrote:
> >
> > -- Waigani <[hidden email]> wrote
> > (on Tuesday, 29 April 2008, 12:40 AM -0700):
> >> Is there a way to add and remove a decorator for all the elements of a
> >> form, not one at a time?
> >
> > No. You have to loop through the elements and sub forms to do this.
> >
> > However... you could also call setElementDecorators() with a revised
> > list of decorators, which would achieve something similar.

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend - The PHP Company   | http://www.zend.com/