本文整理汇总了PHP中Zend_Form_Element_Select::clearDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Select::clearDecorators方法的具体用法?PHP Zend_Form_Element_Select::clearDecorators怎么用?PHP Zend_Form_Element_Select::clearDecorators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Select
的用法示例。
在下文中一共展示了Zend_Form_Element_Select::clearDecorators方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _htmlSelect
/**
* 以<select>标签的形式输出
*
* @param ZtChart_Model_DbTable_Role_Rowset $rowset 数据结果集
* @param array $attributes 需要显示的HTML标签的属性
* @return string
*/
protected function _htmlSelect(ZtChart_Model_DbTable_Role_Rowset $rowset, $attributes = array())
{
if (isset($attributes['options'])) {
$options = $attributes['options'];
unset($attributes['options']);
} else {
$options = array();
}
$htmlSelect = new Zend_Form_Element_Select(array_merge($this->_attributes['select'], $attributes));
$htmlSelect->clearDecorators()->addDecorator('ViewHelper');
$htmlSelect->addMultiOptions($options);
foreach ($rowset as $row) {
$htmlSelect->addMultiOption($row->role_id, $row->role_name);
}
return $htmlSelect;
}
示例2: renderSelect
/**
* 以<select>标签的形式输出
*
* @param array $attributes 需要显示的HTML标签的属性
* @return string
*/
public function renderSelect($attributes = array())
{
if (isset($attributes['options'])) {
$options = $attributes['options'];
unset($attributes['options']);
} else {
$options = array();
}
$htmlSelect = new Zend_Form_Element_Select(array_merge(array('name' => 'formSelect'), $attributes));
$htmlSelect->clearDecorators()->addDecorator('ViewHelper');
$htmlSelect->addMultiOptions($options);
foreach ($this->_resourceRowset as $row) {
$prefix = str_repeat(' ', 2 * (substr_count($row['resource_mvc'], ZtChart_Model_Acl_Resource::SEPARATOR) + 1));
$htmlSelect->addMultiOption($row['resource_id'], $prefix . $row['resource_name']);
}
return $htmlSelect;
}
示例3: addTimezoneElement
public function addTimezoneElement($default = '')
{
require_once 'Zend/Validate/NotEmpty.php';
$notEmpty = new Zend_Validate_NotEmpty();
$notEmpty->setMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => $this->getTranslator()->translate('accountFormHintTimezoneNotEmpty')));
require_once 'Zend/Form/Element/Select.php';
$element = new Zend_Form_Element_Select($this->getTimezoneParam());
$element->clearDecorators()->addDecorator('viewHelper')->setValue($default)->setDisableTranslator(true);
// set options directly for massively enhanced performance
$element->options = $this->getPermiso()->getEnv()->getTimezones();
$this->addElement($element);
return $this;
}