Rumah >pembangunan bahagian belakang >tutorial php > zend_form 装饰器有关问题
zend_form 装饰器问题
表单里有个 项是单选框 ,包括4个选项,怎么让他们在一行显示啊 ,就是控制不好装饰器,初学zend framework,请帮忙指点下下
require_once ('Zend\Form.php');
class MessageForm extends Zend_Form {
public function __construct($options = null){
parent::__construct($options);
$this->setName('message')->setAction('mangaer/message'); //设置表单名称
$m_type = new Zend_Form_Element_radio('m_type'); //添加表单元素
$m_type->setLabel('主题分类')
->setMultiOptions(array('1'=>'我有疑问','2'=>'我的建议','3'=>'翻译服务', '4'=>'网站修改'))
->setRequired(true);
$password = new Zend_Form_Element_Password('password'); //添加表单元素
$password->setLabel('密码')
->setRequired(true)
->clearDecorators()
->addValidator('NotEmpty');
$submit = new Zend_Form_Element_Submit('submit'); //添加提交按钮
$submit->setLabel('提交');
$this->addElements(array($m_type,$password, $submit));//向表单中添加元素
$this->clearDecorators();
$this->addDecorator('FormElements')
->addDecorator('HtmlTag', array('tag' => '