Zend_Form_Element_MultiCheckbox 的使用

用于生成多个Checkbox

$all_record = array('k1'=>'v1', 'k2'=>'v2');
$checked_values = aray('k1');

$checkbox = new Zend_Form_Element_MultiCheckbox('id',
     array('multiOptions' => $all_records)
);

$checkbox->setValue($checked_values);

$this->addElement($checkbox);

Zend_Form_Element_Checkbox 的使用

用于生成一个Checkbox表单

$newsletter= new Zend_Form_Element_Checkbox("newsletter");

$newsletter -> setLabel("newsletter")
    -> setCheckedValue('1')
    -> setUncheckedValue('0')
    -> getDecorator('label')->setOption('placement', 'APPEND');

$form->addElement($newsletter, 'newsletter');

Zend_Form_Element_Select 的使用

$company = new Zend_Form_Element_Select('company', array(
      'multiOptions' => array(
		''=>'请选择:',
		'0' => 'Option0',
		'1' => 'Option1',
		'2' => 'Option2',
		'3' => 'Option3',
    )
  ));

 $company->setLabel("Profession:");

$form->addElement($company, 'company');