本文整理汇总了PHP中Zend_Form_Element_Select::addMultiOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Select::addMultiOptions方法的具体用法?PHP Zend_Form_Element_Select::addMultiOptions怎么用?PHP Zend_Form_Element_Select::addMultiOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Select
的用法示例。
在下文中一共展示了Zend_Form_Element_Select::addMultiOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: carregaOrdenacao
/**
* Carrega os valores de ordenação da consulta do relatório no elemento informado
*
* @param null $sValor
* @param Zend_Form_Element_Select $oElemento
* @return $this
*/
public function carregaOrdenacao($sValor = NULL, Zend_Form_Element_Select $oElemento)
{
$aValoresElemento = array('tomador_cnpjcpf' => parent::$oTranslate->_('CPF/CNPJ Tomador'), 'tomador_razao_social' => parent::$oTranslate->_('Nome/Razão Social Tomador'));
$oElemento->addMultiOptions($aValoresElemento);
$oElemento->setValue($sValor);
return $this;
}
示例2: init
public function init()
{
$this->setMethod('post')->setAttrib('id', 'frmVenta')->setAttrib('style', 'width: 300px;margin:auto;');
// Producto
$e = new Zend_Form_Element_Select('id_producto');
$e->setLabel('Producto');
$e->setRequired();
$_producto = new Application_Model_Producto();
$e->addMultiOption(-1, '--Producto--');
$e->addMultiOptions($_producto->getComboValues());
$e->addValidator(new Zend_Validate_InArray($_producto->getComboValidValues()));
$this->addElement($e);
// Cantidad
$e = new Zend_Form_Element_Text('cantidad');
$e->setLabel('Cantidad');
$e->setRequired();
$e->addValidator(new Zend_Validate_Int(new Zend_Locale('US')));
$e->addValidator(new Zend_Validate_GreaterThan(0));
$e->addValidator(new Zend_Validate_LessThan(100));
$this->addElement($e);
// AddVentaDetalles
$e = new Zend_Form_Element_Hidden('is_detalle');
$e->setValue(true);
$e->setRequired();
$this->addElement($e);
//Submit
$e = new Zend_Form_Element_Submit('submit');
$e->setLabel('Agregar');
$this->addElement($e);
}
示例3: init
public function init()
{
$firstnameField = new Zend_Form_Element_Text('firstname');
$firstnameField->addValidator(new Zend_Validate_Alnum());
$firstnameField->setRequired(true);
$lastnameField = new Zend_Form_Element_Text('lastname');
$lastnameField->addValidator(new Zend_Validate_Alnum());
$lastnameField->setRequired(true);
$emailField = new Zend_Form_Element_Text('email');
$emailField->addValidator(new Zend_Validate_EmailAddress());
$emailField->setRequired(true);
$loginField = new Zend_Form_Element_Text('login');
$loginField->addValidator(new Zend_Validate_Alnum());
$loginField->setRequired(true);
$teamMapper = new User_Model_Mapper_Team();
$teamArray = $teamMapper->getList();
foreach ($teamArray as $rowTeam) {
$teams[$rowTeam->getId()] = $rowTeam->getName();
}
$teamField = new Zend_Form_Element_Select('team');
$teamField->addMultiOptions($teams);
$idField = new Zend_Form_Element_Hidden('id');
$passwordField = new Zend_Form_Element_Password('password');
$passwordField->addValidator(new Zend_Validate_StringLength(array('min' => 6, 'max' => 18)));
$submitBtn = new Zend_Form_Element_Submit('submit');
$this->addElements(array($firstnameField, $lastnameField, $emailField, $loginField, $passwordField, $teamField, $idField, $submitBtn));
$this->setAction('');
}
示例4: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'frm_interview_rpt');
$interview_date = new Zend_Form_Element_Text("interview_date");
$interview_date->setLabel("Interview Date");
$interview_date->setAttrib('readonly', 'readonly');
$req_id = new Zend_Form_Element_Select("req_id");
$req_id->setRegisterInArrayValidator(false);
$req_id->setLabel("Requisition Code")->addMultiOptions(array('' => 'Select Requisition Code'));
$department_id = new Zend_Form_Element_Select("department_id");
$department_id->setLabel("Department");
$department_id->setRegisterInArrayValidator(false);
$department_id->addMultiOptions(array('' => 'Select Department'));
$interviewer_id = new Zend_Form_Element_Text("interviewer_id");
$interviewer_id->setLabel("Interviewer");
$interviewer_id->setAttrib('name', '');
$interviewer_id->setAttrib('id', 'idinterviewer_id');
$createdby = new Zend_Form_Element_Text("createdby");
$createdby->setLabel("Interview Planned By");
$createdby->setAttrib('name', '');
$createdby->setAttrib('id', 'idcreatedby');
$submit = new Zend_Form_Element_Button('submit');
$submit->setAttrib('id', 'idsubmitbutton');
$submit->setLabel('Report');
$this->addElements(array($submit, $interview_date, $req_id, $department_id, $interviewer_id, $createdby));
$this->setElementDecorators(array('ViewHelper'));
}
示例5: init
/** Initialize this form. */
public function init()
{
$this->setName('sizequota_folder');
$this->setAction($this->getView()->baseUrl('/sizequota/folder/submit'));
$this->setMethod('POST');
$csrf = new Midas_Form_Element_Hash('csrf');
$csrf->setSalt('FDXuUnSDkUE7Anh2kqgca8zv');
$csrf->setDecorators(array('ViewHelper'));
$folderId = new Zend_Form_Element_Hidden('folder_id');
$folderId->setDecorators(array('ViewHelper'));
$useDefaultFolderQuota = new Zend_Form_Element_Checkbox('use_default_folder_quota');
$useDefaultFolderQuota->setLabel('Use Default Folder Quota');
$folderQuotaValue = new Zend_Form_Element_Text('folder_quota_value');
$folderQuotaValue->setLabel('Quota');
$folderQuotaValue->addValidator('Float', true);
$folderQuotaValue->addValidator('Between', true, array('min' => 0, 'max' => PHP_INT_MAX));
$folderQuotaUnit = new Zend_Form_Element_Select('folder_quota_unit');
$folderQuotaUnit->setLabel('Unit');
$folderQuotaUnit->setRequired(true);
$folderQuotaUnit->addValidator('NotEmpty', true);
$folderQuotaUnit->addMultiOptions(array(MIDAS_SIZE_B => 'B', MIDAS_SIZE_KB => 'KB', MIDAS_SIZE_MB => 'MB', MIDAS_SIZE_GB => 'GB', MIDAS_SIZE_TB => 'TB'));
$this->addDisplayGroup(array($useDefaultFolderQuota, $folderQuotaValue, $folderQuotaUnit), 'global');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Save');
$this->addElements(array($csrf, $folderId, $useDefaultFolderQuota, $folderQuotaValue, $folderQuotaUnit, $submit));
}
示例6: init
/** Initialize this form. */
public function init()
{
$this->setName('sizequota_admin');
$this->setMethod('POST');
$csrf = new Midas_Form_Element_Hash('csrf');
$csrf->setSalt('f6g5NzqPWAunkSykbBpmTmpH');
$csrf->setDecorators(array('ViewHelper'));
$defaultUserQuotaValue = new Zend_Form_Element_Text(MIDAS_SIZEQUOTA_DEFAULT_USER_QUOTA_VALUE_KEY);
$defaultUserQuotaValue->setLabel('Default User Quota');
$defaultUserQuotaValue->addValidator('Float', true);
$defaultUserQuotaValue->addValidator('Between', true, array('min' => 0, 'max' => PHP_INT_MAX));
$defaultUserQuotaUnit = new Zend_Form_Element_Select(MIDAS_SIZEQUOTA_DEFAULT_USER_QUOTA_UNIT_KEY);
$defaultUserQuotaUnit->setLabel('Unit');
$defaultUserQuotaUnit->setRequired(true);
$defaultUserQuotaUnit->addValidator('NotEmpty', true);
$defaultUserQuotaUnit->addMultiOptions(array(MIDAS_SIZE_B => 'B', MIDAS_SIZE_KB => 'KB', MIDAS_SIZE_MB => 'MB', MIDAS_SIZE_GB => 'GB', MIDAS_SIZE_TB => 'TB'));
$this->addDisplayGroup(array($defaultUserQuotaValue, $defaultUserQuotaUnit), 'default_user_quota');
$defaultCommunityQuotaValue = new Zend_Form_Element_Text(MIDAS_SIZEQUOTA_DEFAULT_COMMUNITY_QUOTA_VALUE_KEY);
$defaultCommunityQuotaValue->setLabel('Default Community Quota');
$defaultCommunityQuotaValue->addValidator('Float', true);
$defaultCommunityQuotaValue->addValidator('Between', true, array('min' => 0, 'max' => PHP_INT_MAX));
$defaultCommunityQuotaUnit = new Zend_Form_Element_Select(MIDAS_SIZEQUOTA_DEFAULT_COMMUNITY_QUOTA_UNIT_KEY);
$defaultCommunityQuotaUnit->setLabel('Unit');
$defaultCommunityQuotaUnit->setRequired(true);
$defaultCommunityQuotaUnit->addValidator('NotEmpty', true);
$defaultCommunityQuotaUnit->addMultiOptions(array(MIDAS_SIZE_B => 'B', MIDAS_SIZE_KB => 'KB', MIDAS_SIZE_MB => 'MB', MIDAS_SIZE_GB => 'GB', MIDAS_SIZE_TB => 'TB'));
$this->addDisplayGroup(array($defaultCommunityQuotaValue, $defaultCommunityQuotaUnit), 'default_community_quota');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Save');
$this->addElements(array($csrf, $defaultUserQuotaValue, $defaultUserQuotaUnit, $defaultCommunityQuotaValue, $defaultCommunityQuotaUnit, $submit));
}
示例7: _timezone
protected function _timezone()
{
$element = new Zend_Form_Element_Select('timezone');
$element->setLabel('Timezone')->addDecorators($this->_decorators)->setRequired(true)->setAttrib('class', 'span4');
$timezones = array();
$timezoneIdentifiers = DateTimeZone::listIdentifiers();
foreach ($timezoneIdentifiers as $timezone) {
if (preg_match('/^(Africa|America|Antarctica|Asia|Atlantic|Europe|Indian|Pacific)\\//', $timezone)) {
$ex = explode('/', $timezone);
$city = isset($ex[2]) ? $ex[1] . ' - ' . $ex[2] : $ex[1];
$name = $ex[0];
$timezones[$name][$timezone] = $city;
$dateTimeZoneGmt = new DateTimeZone('GMT');
$dateTimeZone = new DateTimeZone($timezone);
$dateTimeGmt = new DateTime("now", $dateTimeZoneGmt);
$timeOffset = $dateTimeZone->getOffset($dateTimeGmt);
$gmt = $timeOffset / 3600;
if ($gmt == 0) {
$gmt = ' 00';
} elseif ($gmt > 0 && $gmt < 10) {
$gmt = '+0' . $gmt;
} elseif ($gmt >= 10) {
$gmt = '+' . $gmt;
} elseif ($gmt < 0 && $gmt > -10) {
$gmt = '-0' . abs($gmt);
}
$timezones[$name][$timezone] = substr($timezone, strlen($name) + 1) . ' (GMT ' . $gmt . ':00)';
}
}
$element->addMultiOptions($timezones);
return $element;
}
示例8: init
public function init()
{
$this->setName(strtolower(get_class()));
$this->setMethod("post");
$oFormName = new Zend_Form_Element_Hidden("form_name");
$oFormName->setValue(get_class());
$oFormName->setIgnore(FALSE)->removeDecorator("Label");
$this->addElement($oFormName);
$oFileName = new Zend_Form_Element_Select("file_name");
$oFileName->setLabel("Plik phtml:");
$oFileName->setRequired(TRUE);
//$oFileName->addValidator(new Zend_Validate_InArray(array_keys($this->_aAllFile)));
$oFileName->addMultiOptions($this->_aAllFile);
$oFileName->setAttrib("class", "valid");
$this->addElement($oFileName);
$this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
$this->getElement("csrf_token")->removeDecorator("Label");
$oSubmit = $this->createElement("submit", "submit");
$oSubmit->setLabel("Wczytaj plik");
$this->addElement($oSubmit);
$oViewScript = new Zend_Form_Decorator_ViewScript();
$oViewScript->setViewModule("admin");
$oViewScript->setViewScript("_forms/_defaultform.phtml");
$this->clearDecorators();
$this->setDecorators(array(array($oViewScript)));
$oElements = $this->getElements();
foreach ($oElements as $oElement) {
$oElement->setFilters($this->_aFilters);
$oElement->removeDecorator("Errors");
}
}
示例9: init
public function init()
{
$this->setName(strtolower(get_class()));
$this->setMethod("post");
$oFormName = new Zend_Form_Element_Hidden("form_name");
$oFormName->setValue(get_class());
$oFormName->setIgnore(FALSE)->removeDecorator("Label");
$this->addElement($oFormName);
$oAddressSelect = new Zend_Form_Element_Select("address_select");
$oAddressSelect->setLabel("Nazwa:");
$oAddressSelect->setRequired(FALSE);
$oAddressSelect->addMultiOptions($this->_aAllAddressName);
$this->addElement($oAddressSelect);
$oAddressAnswer = new Zend_Form_Element_Textarea("address_answer");
$oAddressAnswer->setLabel("Odpowiedź:")->setFilters($this->_aFilters);
$oAddressAnswer->setRequired(TRUE);
$oAddressAnswer->setAttrib("class", "valid");
$this->addElement($oAddressAnswer);
$oSubmit = new Zend_Form_Element_Submit("submit_add_address");
$oSubmit->setLabel("Dodaj");
$this->addElement($oSubmit);
$this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
$this->getElement("csrf_token")->removeDecorator("Label");
$oViewScript = new Zend_Form_Decorator_ViewScript();
$oViewScript->setViewModule("admin");
$oViewScript->setViewScript("_forms/_defaultform.phtml");
$this->clearDecorators();
$this->setDecorators(array(array($oViewScript)));
$oElements = $this->getElements();
foreach ($oElements as $oElement) {
$oElement->setFilters($this->_aFilters);
$oElement->removeDecorator("Errors");
}
}
示例10: init
public function init($topicId)
{
global $mySession;
$db = new Db();
$topicTitle = "";
$topicDescription = "";
$topicStatus = "1";
if ($topicId != "") {
$topicData = $db->runQuery("select * from " . FORUM_TOPICS . " where topic_id='" . $topicId . "'");
$topicTitle = $topicData[0]['topic_title'];
$topicDescription = $topicData[0]['topic_description'];
$topicStatus = $topicData[0]['topic_status'];
}
$StatusArr = array();
$StatusArr[0]['key'] = "1";
$StatusArr[0]['value'] = "Enable";
$StatusArr[1]['key'] = "0";
$StatusArr[1]['value'] = "Disable";
$topic_status = new Zend_Form_Element_Select('topic_status');
$topic_status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($topicStatus);
$topic_title = new Zend_Form_Element_Text('topic_title');
$topic_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Topic title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($topicTitle);
$topic_description = new Zend_Form_Element_Textarea('topic_description');
$topic_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Topic description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setValue($topicDescription);
$this->addElements(array($topic_status, $topic_title, $topic_description));
}
示例11: init
public function init()
{
$this->setName(strtolower(get_class()));
$this->setMethod("post");
$oFormName = new Zend_Form_Element_Hidden("form_name");
$oFormName->setValue(get_class());
$oFormName->setIgnore(FALSE)->removeDecorator("Label");
$this->addElement($oFormName);
$oTranslation = new Zend_Form_Element_Select("translation");
$oTranslation->setLabel("Tłumaczenie:");
$oTranslation->setRequired(TRUE)->setAttrib("class", "valid");
$oTranslation->addMultiOptions($this->_aAllLang);
$this->addElement($oTranslation);
$this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
$this->getElement("csrf_token")->removeDecorator("Label");
$oSubmit = $this->createElement("submit", "submit");
$oSubmit->setLabel("Dalej");
$this->addElement($oSubmit);
$oViewScript = new Zend_Form_Decorator_ViewScript();
$oViewScript->setViewModule("admin");
$oViewScript->setViewScript("_forms/lang.phtml");
$this->clearDecorators();
$this->setDecorators(array(array($oViewScript)));
$oElements = $this->getElements();
foreach ($oElements as $oElement) {
$oElement->setFilters($this->_aFilters);
$oElement->removeDecorator("Errors");
}
}
示例12: __construct
public function __construct($option = null)
{
parent::__construct($option);
$this->setName('sum');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Сумын нэрийг оруулна уу ?')->setRequired(true)->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control");
$aimag = new Zend_Form_Element_Select("aimag");
//create obj
$aimag->setAttrib('class', "form-control")->setRequired()->setLabel("Та аймагаа сонгоно уу?");
$params = array('host' => '127.0.0.1', 'username' => 'root', 'password' => '', 'dbname' => 'dun');
$db = Zend_Db::factory("mysqli", $params);
$sql = $db->quoteInto('select * from aimag', null);
$users = $db->query($sql)->fetchAll();
$userArray = array();
foreach ($users as $user) {
/*use value as the key,while form submited,key was added into response obj*/
$userArray[$user['name']] = $user['name'];
//create the $list
}
$aimag->addMultiOptions($userArray);
$add = new Zend_Form_Element_Submit('add');
$add->setLabel('Нэмэх')->setAttrib('class', 'btn');
$this->addElement($aimag);
$this->addElement($name);
$this->addElement($add);
$this->setMethod('post');
}
示例13: __construct
public function __construct(array $dataBusinessId, $options = null)
{
parent::__construct($options);
$this->setName('frmEmployee');
$this->setMethod('post');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Employee name');
$name->setAttrib('maxlength', 80);
$name->setRequired(true);
$name->addValidator(new Zend_Validate_NotEmpty());
$this->addElement($name);
$age = new Zend_Form_Element_Text('age');
$age->setLabel('Employee age');
$age->addValidator(new Zend_Validate_Int());
$this->addElement($age);
$businessId = new Zend_Form_Element_Select('business_id');
$businessId->setLabel('Business');
$businessId->setRequired(true);
$businessId->addValidator(new Zend_Validate_NotEmpty());
$businessId->addValidator(new Zend_Validate_Int());
$businessId->addMultiOptions($dataBusinessId);
$this->addElement($businessId);
$submit = new Zend_Form_Element_Submit('bt_submit');
$submit->setLabel('Save');
$this->addElement($submit);
}
示例14: buildExtraElements
protected function buildExtraElements()
{
$pricesTable = new Refprice();
logfire('$this->_business->getBusinessTypeId()', $this->_business->getBusinessTypeId());
$prices = $pricesTable->getPriceOptions($this->_business->getBusinessTypeId(), $this->_location->getSearchRules()->currency);
$min = new Zend_Form_Element_Select('min');
$min->setLabel('Min');
$min->setAttrib('class', 'refineformmoneyselect');
$min->addMultiOptions($prices);
$this->addElement($min);
$max = new Zend_Form_Element_Select('max');
$max->setLabel('Max');
$max->setAttrib('class', 'refineformmoneyselect');
$max->addMultiOptions($prices);
$this->addElement($max);
$facilifies = array('Any' => 'Any', '-1' => 'NA', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '100' => '6+');
$bedOptions = array('Any' => 'Any', '-1' => 'NA', '0' => 'Studio', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '100' => '6+');
$bed = new Zend_Form_Element_Select('bed');
$bed->setLabel('Bed');
$bed->setAttrib('class', 'refineformmoneyselect');
$bed->addMultiOptions($bedOptions);
$this->addElement($bed);
$cars = new Zend_Form_Element_Select('cars');
$cars->setLabel('Cars');
$cars->setAttrib('class', 'refineformmoneyselect');
$cars->addMultiOptions($facilifies);
$this->addElement($cars);
$bath = new Zend_Form_Element_Select('bath');
$bath->setLabel('Bath');
$bath->setAttrib('class', 'refineformmoneyselect');
$bath->addMultiOptions($facilifies);
$this->addElement($bath);
return parent::buildExtraElements();
}
示例15: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'frm_requisition_report');
$raised_by = new Zend_Form_Element_Text("raised_by");
$raised_by->setLabel("Raised By");
$raised_by->setAttrib('name', '');
$raised_by->setAttrib('id', 'idraised_by');
$raised_by->setAttrib('title', 'Raised By');
$requisition_status = new Zend_Form_Element_Select("req_status");
$requisition_status->setLabel("Requisition Status");
$requisition_status->addMultiOptions(array('' => 'Select Requisition Status', 'Initiated' => 'Initiated', 'Approved' => 'Approved', 'Rejected' => 'Rejected', 'Closed' => 'Closed', 'On hold' => 'On hold', 'Complete' => 'Complete', 'In process' => 'In process'));
$requisition_status->setAttrib('title', 'Requisition Status');
$raised_in = new Zend_Form_Element_Select('createdon');
$raised_in->setLabel('Raised In');
$raised_in->setAttrib('id', 'createdon');
$reporting_manager = new Zend_Form_Element_Text("reporting_manager");
$reporting_manager->setLabel("Reporting Manager");
$reporting_manager->setAttrib('name', '');
$reporting_manager->setAttrib('id', 'idreporting_manager');
$job_title = new Zend_Form_Element_Select("jobtitle");
$job_title->setLabel("Job Title");
$job_title->setAttrib("onchange", "getpositions_req('department','business_unit','position_id','jobtitle');");
$job_title->setAttrib('title', 'Job Title.');
$submit = new Zend_Form_Element_Button('submit');
$submit->setAttrib('id', 'idsubmitbutton');
$submit->setLabel('Report');
$this->addElements(array($raised_by, $requisition_status, $raised_in, $reporting_manager, $job_title, $submit));
$this->setElementDecorators(array('ViewHelper'));
}