Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The radio buttons in Zend Framework are displayed in a column (one option per line). How can I remove the br tag from the markup so that all radio options stay in one line?

My decorators are:

private $radioDecorators = array(
    'Label',
    'ViewHelper',
    array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'radio')),
    array(array('row' => 'HtmlTag'), array('tag' => 'li')),
);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
171 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to call the setSeparator method on the Zend_Form_Element_Radio object, passing it ''. Here's an example from here:

<?php     

class CustomForm extends Zend_Form
{
  public function init()
  {
    $this->setMethod('post');
    $this->setAction('user/process');
    $gender = new Zend_Form_Element_Radio('gender');
    $gender->setLabel('Gender:')
      ->addMultiOptions(array(
        'male' => 'Male',
        'female' => 'Female'
      ))
      ->setSeparator('');
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...