Organizational Research By

Surprising Reserch Topic

display zend form element radio on one line using -'php,zend-framework,zend-form,radio-button'


display zend form element radio on one line  using -'php,zend-framework,zend-form,radio-button'

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')),
);

    

asked Sep 8, 2015 by rajesh
0 votes
27 views



Related Hot Questions

2 Answers

0 votes
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(''); } }
answered Sep 8, 2015 by rajesh
0 votes
Use the Zend_Form_Element_Radio::setSeparator($separator) method: e.g. $element->setSeparator(''); The separator defaults to '\<\br />' as shown by getSeparator().
answered Sep 8, 2015 by rajesh

...