本文整理匯總了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;
}