associated array elements in zend form

后端 未结 2 634
囚心锁ツ
囚心锁ツ 2021-01-24 00:11

Been trying to find a solution for this for a while with not much luck...

Need to render a form with an array of checkboxes each having an associated textbox.

gi

2条回答
  •  长情又很酷
    2021-01-24 00:35

    just create a custom decorator, extends from Zend_Form_Decorator_Abstract and define the function render, which returns the html that you define inside, for example you can do:

    $html = ''; // some code html
    $i = 0;
    foreach ($element->getMultiOptions() as $value => $label){
        $html .= '';
        $i++;
    }
    return $html;
    

提交回复
热议问题