Editing individual switches in a zend script form

I have a zend form that uses a script view. I want to access individual switch elements, but I'm not sure how to do this. Right now, I'm just printing them all using:

echo $this->element->getElement('myRadio');

This displays them vertically. I need a little more control. I need to be able to print the first 5 parameters in one column, and then in the next 5 in the second column.

+1
source share
2 answers

Thought of it too. Just use

$this->element->getElment('myRadio')->getMultiOptions();

and it will return an array of key / value parameters.

+1
source

I have the same problem. There is no good way to do this that I found (near ZF 1.10.8)

' :

http://framework.zend.com/issues/browse/ZF-2977

. , , .

, .

, , , :

:

$radio = new Zend_Form_Element_Radio('MYRADIO');
$radio->addMultiOption('OPTION1', 'Option One')
      ->addMultiOption('OPTION2', 'Option Two');

$this->addElement($radio);

script, OPTION1:

echo $this->formRadio(
    $this->form->MYRADIO->getFullyQualifiedName(),
    $this->form->MYRADIO->getValue(),
    null,
    array('OPTION1' => $this->form->MYRADIO->getMultiOption('OPTION1'))
);

<input type="radio" /> <label>. , .

, , ViewScript, , .

+4

Source: https://habr.com/ru/post/1778727/


All Articles