setName('search');
$this->setAction('/search');
$this->setMethod('get');
$q = new Zend_Form_Element_Text('q');
$q->setRequired(true)
->addFilter('StringTrim')
->addValidator('NotEmpty');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('搜索');
$this->addElements(array($q,$submit));
$this->clearDecorators();
$this->addDecorator('FormElements')
->addDecorator('HtmlTag', array('tag' => '
'))
->addDecorator('Form');
$this->setElementDecorators(array(
array('ViewHelper'),
array('Errors'),
array('Description'),
array('Label', array('separator'=>' ')),
array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')),
));
// buttons do not need labels
$submit->setDecorators(array(
array('ViewHelper'),
array('Description'),
array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')),
));
}
}