Quantcast

Zend Form: Multiple buttons on one line

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Zend Form: Multiple buttons on one line

Mary Nicole Hicks
This one has me stumped. I am just adding buttons to a form with Zend Framework. Each of these buttons is ending up on a single line.

Does anyone know how to get multiple buttons on to one line using Zend_Form?
Any example code to do this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend Form: Multiple buttons on one line

weierophinney
Administrator
-- Mary Nicole Hicks <[hidden email]> wrote
(on Wednesday, 30 July 2008, 08:04 PM -0700):
>
> This one has me stumped. I am just adding buttons to a form with Zend
> Framework. Each of these buttons is ending up on a single line.
>
> Does anyone know how to get multiple buttons on to one line using Zend_Form?
> Any example code to do this?

There are a variety of ways. First, you can use different decorators. By
default, buttons are in a <dd> of their own, which is why you see them
on multiple lines.

Another way is to use a display group. This will allow you to wrap all
the buttons in a single <dd>; it would best be used in conjunction with
the previous suggestion. That might look something like this:

    // assume 'save', 'cancel', and 'reset' are buttons with the
    // following decorator(s):
    //     array('ViewHelper');
    $form->addDisplayGroup(array('save', 'cancel', 'reset'), array(
        'decorators' => array(
            'FormElements',
            'DtDdWrapper',
        ),
    ));

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend Framework           | http://framework.zend.com/
Loading...