-- Borje <[EMAIL PROTECTED]> wrote
(on Wednesday, 16 April 2008, 05:00 AM -0700):
> 
> 
> Matthew Weier O'Phinney-3 wrote:
> > 
> > Plus, you'll need to ensure the elements and labels are in table data
> > and table rows:
> > 
> >     $form->setElementDecorators(array(
> >         'ViewHelper',
> >         'Errors',
> >         array('decorator' => array('td' => 'HtmlTag'), 'options' =>
> > array('tag' => 'td')),
> >         array('Label', array('tag' => 'td')),
> >         array('decorator' => array('tr' => 'HtmlTag'), 'options' =>
> > array('tag' => 'tr')),
> >     ));
> > 
> > For your 'submit' button, you'll want to modify the decorators so the
> > submit spans both columns:
> > 
> >     $form->submit->setDecorators(array(
> >         array(
> >             'decorator' => 'ViewHelper', 
> >             'options' => array('helper' => 'formSubmit')),
> >         array(
> >             'decorator' => array('td' => 'HtmlTag'), 
> >             'options' => array('tag' => 'td', 'colspan' => 2)),
> >         array(
> >             'decorator' => array('tr' => 'HtmlTag'), 
> >             'options' => array('tag' => 'tr')),
> >     ));
> > 
> > Enjoy.
> 
> This works great except for two issues I have. I want to be able to put the
> submit button aligned with the form fields which means I would like to have
> and empty <td> where the label would print id we chose to display it. 

You should create a custom decorator for that, then -- have it simply
emit a <td></td> -- and attach it to that button.

> I would also like to have the ability to have the labels on the right
> hand side and the form fields on the left. How do I set the decorators
> to do this?

Pass the 'placement' => 'append' option to the Label decorator.

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

Reply via email to