Creating Zend_Form elements from row html
I am having an issue with Zend_Form and your help will be appreciated. in fact I have a class to generate categories as options
$categories = My_Util_Category::toHtmlSelect();//for simplicity I removed other lines
this code gene开发者_如何学运维rates
<select>
<option > root</option>
<option> root / children</option>
</select>
On another hand, I use Zend_Form form to edit categories. The code looks like:
$form = My_Form_Category( $data, $selectElements = array() );
which outputs a form, text field, a select box for parent categories and a submit button.
How can I get 'select element' from $form, and replace it with row html 'select' generated with $categories
any help, or link will be appreciated. Thanks.
Well, I changed the drop down list, and instead of
$categories = My_Util_Category::toHtmlSelect();
I have
$categoryList = My_Util_Category::getCategoryList();
which returns an array and pass returned array to the form constructor as
$form = My_Form_Category( $data, $categoryList );
Hope that it will help some body else.
精彩评论