klapaucius
klapaucius

Reputation: 117

Zend1 - form radio decorators

I create in Zend a nawe field (radio):

$sizeId = $this->createElement('radio', 'size_id');

But i need get in view code looks like this:

<li>
   <input ...>
   <label><span>name</span></label>     
</li>

How to do it?

I did this code:

$sizeId = $this->createElement('radio', 'size_id', array(
            'decorators' => array(
                'ViewHelper',
                array(array('AddTheLi' => 'HtmlTag'), array('tag' => 'li')),
                array(array('AddTheUl' => 'HtmlTag'), array('tag' => 'ul', 'class' => 'size-picker clearfix')),
                'Errors',
                array('Description', array('tag' => 'p', 'class' => 'description')),

            ),
            'disableLoadDefaultDecorators' => true,
            'separator' => '</li><li>',
            'class' => 'attribute-radio',
        ));

But no the code in view looks like this:

<li>
   <label><input ...>name</label>     
</li>

Why the input is in label?

Upvotes: 1

Views: 109

Answers (0)

Related Questions