Quantcast

Viewscript for MultiCheckbox

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Viewscript for MultiCheckbox

will barker
Hi, Im having trouble displaying a checkbox element with a custom viewscript, what would the default viewscript for these elements look like.

atm, i have this in the form:

        $el = new Zend_Form_Element_MultiCheckbox('userSpecialization');
        $el->setLabel('Specialisation:');
        $el->addMultiOptions(App_Library::simpleArray('Specialization'));
       
        #$el->viewScript = '_element_multi.phtml'; // dosn't work!
        $el->setDecorators(array(array('ViewScript', array(
    'viewScript' => '_element_multi.phtml'
                        ))));

with this viewscript:

<div id="<?= $this->id ?>">
        <dt>
    <?= $this->formLabel($this->element->getName(),
                         $this->element->getLabel()) ?>
     </dt>
     <dd>                   
    <?= $this->{$this->element->helper}(
        $this->element->getName(),
        $this->element->getValue(),
        $this->element->getAttribs()
    ) ?>
    </dd>
    <?= $this->formErrors($this->element->getMessages()) ?>
    <div class="hint"><?= $this->element->getDescription() ?></div>
</div>

The label shows up, but no checkboxes. Whats up?
Loading...