本文整理汇总了PHP中Zend_Form_Element_Select::addMultiOption方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Select::addMultiOption方法的具体用法?PHP Zend_Form_Element_Select::addMultiOption怎么用?PHP Zend_Form_Element_Select::addMultiOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Select
的用法示例。
在下文中一共展示了Zend_Form_Element_Select::addMultiOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'empscreeningreport');
$this->setAttrib('action', BASE_URL . 'reports/empscreening');
$specimen = new Zend_Form_Element_Select('specimen');
$specimen->setLabel('Select Employee/Candidate');
$specimen->addMultiOption('', 'Select Employee/Candidate');
$specimen->addMultiOption('1', 'Employee');
$specimen->addMultiOption('2', 'Candidate');
$empname = new Zend_Form_Element_Text('empname');
$empname->setLabel('Employee / Candidate Name');
$empname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
$empname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
$agencyname = new Zend_Form_Element_Text('agencyname');
$agencyname->setLabel('Agency Name');
$agencyname->setAttrib('class', 'selectoption');
$agencyname->addValidator("regex", true, array('pattern' => '/^([a-zA-Z.\\-]+ ?)+$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
$agencyname->setAttrib('onblur', 'clearEmpScreeningAutoCompleteNames(this)');
$screeningtype = new Zend_Form_Element_Multiselect('screeningtype');
$screeningtype->setLabel('Screening Type');
$checktypeModal = new Default_Model_Bgscreeningtype();
$typesData = $checktypeModal->fetchAll('isactive=1', 'type');
foreach ($typesData->toArray() as $data) {
$screeningtype->addMultiOption($data['id'], $data['type']);
}
$screeningtype->setRegisterInArrayValidator(false);
$process_status = new Zend_Form_Element_Select('process_status');
$process_status->setLabel('Select Status');
$process_status->addMultiOption('', 'Select Status');
$process_status->addMultiOption('In process', 'In process');
$process_status->addMultiOption('Complete', 'Complete');
$process_status->addMultiOption('On hold', 'On hold');
$month = new Zend_Form_Element_Select('month');
$month->setLabel('Select Month');
$month->addMultiOption('', 'Select Month');
$monthnamesarray = array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
for ($i = 1; $i <= sizeof($monthnamesarray); $i++) {
$month->addMultiOption($i, $monthnamesarray[$i]);
}
$year = new Zend_Form_Element_Select('year');
$year->setLabel('Select Year');
$curYear = date("Y");
$preYear = $curYear - 10;
$year->addMultiOption('', 'Select Year');
for ($i = $preYear; $i <= $curYear; $i++) {
$year->addMultiOption($i, $i);
}
$this->addElements(array($specimen, $empname, $agencyname, $screeningtype, $process_status, $month, $year));
$this->setElementDecorators(array('ViewHelper'));
}
示例2: __construct
public function __construct($options = null)
{
$baseDir = $options['baseDir'];
parent::__construct($options);
/****************************************/
// PARAMETERS
/****************************************/
// Build the select to choose the associated form (Parameter #1)
$blockForm = new Zend_Form_Element_Select('Param1');
$blockForm->setLabel('Formulaire associé à ce bloc')->setAttrib('class', 'largeSelect');
$forms = new Form();
$select = $forms->getFormList();
$formsArray = $forms->fetchAll($select);
// Set the default value
$blockForm->addMultiOption('0', 'Choisir un formulaire');
//Fill the dropdown list
foreach ($formsArray as $form) {
$blockForm->addMultiOption($form['F_ID'], $form['FI_Title']);
}
// Test if a value has been chosen
$at_least_one = new Zend_Validate_GreaterThan('0');
$at_least_one->setMessage('Vous devez choisir un élément dans la liste.');
$blockForm->addValidator($at_least_one);
$this->addElements(array($blockForm));
$this->removeDisplayGroup('parameters');
$this->addDisplayGroup(array('Param999', 'Param1'), 'parameters');
$parameters = $this->getDisplayGroup('parameters');
}
示例3: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('filtype');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$ext = new Zend_Form_Element_Text('ext');
$ext->setLabel('ext');
$class = new Zend_Form_Element_Textarea('class');
$class->setLabel('class');
$label = new Zend_Form_Element_Text('label');
$label->setLabel('label');
$uploadable = new Zend_Form_Element_Text('uploadable');
$uploadable->setLabel('uploadable');
$clientResizable = new Zend_Form_Element_Text('clientresizeable');
$clientResizable->setLabel('clientresizeable');
$mimeType = new Zend_Form_Element_Textarea('mimetype');
$mimeType->setLabel('mimetype');
$fileMediaTypeId = new Zend_Form_Element_Select('filmediatype_id');
$options = new Filmediatype();
$fileMediaTypeId->addMultiOption('', '----------');
foreach ($options->fetchAlltoFlatArray() as $k => $v) {
$fileMediaTypeId->addMultiOption($k, $v['mlabel']);
}
$fileMediaTypeId->setLabel('filmediatype_id');
$fileMetaDataFileType = new FilmetadatalistForm('FilmetadataFiltype');
$fileMetaDataFileType->setLabel('FilmetadataFiltype');
$this->addElements(array($id, $hash, $ext, $class, $label, $uploadable, $clientResizable, $mimeType, $fileMediaTypeId, $fileMetaDataFileType));
$this->addElements(array($submit));
}
示例4: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('pagstats');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$pagStructureId = new Zend_Form_Element_Select('pagstructure_id');
$options = new Pagstructure();
$pagStructureId->addMultiOption('', '----------');
foreach ($options->fetchAlltoFlatArray() as $k => $v) {
$pagStructureId->addMultiOption($k, $v['mlabel']);
}
$pagStructureId->setLabel('pagstructure_id');
$views = new Zend_Form_Element_Text('views');
$views->setLabel('views');
$unique = new Zend_Form_Element_Text('unique');
$unique->setLabel('unique');
$timeOnPage = new Zend_Form_Element_Text('timeonpage');
$timeOnPage->setLabel('timeonpage');
$bounces = new Zend_Form_Element_Text('bounces');
$bounces->setLabel('bounces');
$exits = new Zend_Form_Element_Text('exits');
$exits->setLabel('exits');
$this->addElements(array($id, $hash, $pagStructureId, $views, $unique, $timeOnPage, $bounces, $exits));
$this->addElements(array($submit));
}
示例5: init
public function init()
{
$holidayname = new Zend_Form_Element_Text('holidayname');
$holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname'));
$holidayname->setAttrib('class', 'txt_put');
$holidayname->setRequired(true)->addValidators(array(array('NotEmpty')));
$office_id = new Zend_Form_Element_Select('office_id');
$office_id->addMultiOption('', 'Select...');
$office_id->addMultiOption('All', 'All');
$office_id->setAttrib('class', 'txt_put');
$office_id->setRequired(true)->addValidators(array(array('NotEmpty')));
$holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id');
$holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom');
$holidayfrom->setAttrib('class', 'txt_put');
$holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd');
$holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
$holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto');
$holidayupto->setAttrib('class', 'txt_put');
$holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd');
$holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
$repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date');
$repayment_date->setAttrib('class', 'txt_put');
$repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd');
$repayment_date->setRequired(true)->addValidators(array(array('NotEmpty')));
array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'));
$submit = new Zend_Form_Element_Submit('Submit');
$submit->removeDecorator('DtDdWrapper');
$this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit));
}
示例6: __construct
public function __construct($options = null)
{
$baseDir = $options['baseDir'];
$pageID = $options['pageID'];
parent::__construct($options);
/****************************************/
// PARAMETERS
/****************************************/
// select box category (Parameter #1)
$blockCategory = new Zend_Form_Element_Select('Param1');
$blockCategory->setLabel($this->getView()->getCibleText('form_gallery_blockCategory_label'))->setAttrib('class', 'largeSelect')->setOrder(11);
$categories = new Categories();
$select = $categories->select()->setIntegrityCheck(false)->from('Categories')->join('CategoriesIndex', 'C_ID = CI_CategoryID')->where('C_ModuleID = ?', 9)->where('CI_LanguageID = ?', Zend_Registry::get("languageID"))->order('CI_Title');
$categoriesArray = $categories->fetchAll($select);
foreach ($categoriesArray as $category) {
$blockCategory->addMultiOption($category['C_ID'], $category['CI_Title']);
}
$this->addElement($blockCategory);
$blockGallery = new Zend_Form_Element_Select('Param2');
$blockGallery->setLabel($this->getView()->getCibleText('form_gallery_blockGallerey_label'))->setAttrib('class', 'largeSelect')->setOrder(12);
$galleries = new Galleries();
$selectG = $galleries->select()->setIntegrityCheck(false)->from('Galleries')->join('GalleriesIndex', 'G_ID = GI_GalleryID')->where('G_Online = 1')->where('GI_LanguageID = ?', Zend_Registry::get("languageID"))->order('GI_Title');
$galleriesArray = $galleries->fetchAll($selectG);
//echo $selectG;
$blockGallery->addMultiOption('0', $this->getView()->getCibleText('form_gallery_blockGallerey_None'));
foreach ($galleriesArray as $gallery) {
$blockGallery->addMultiOption($gallery['GI_GalleryID'], $gallery['GI_Title']);
}
$this->addElement($blockGallery);
$this->removeDisplayGroup('parameters');
$this->addDisplayGroup(array('Param999', 'Param1', 'Param2'), 'parameters');
$parameters = $this->getDisplayGroup('parameters');
}
示例7: init
public function init()
{
require_once APPLICATION_PATH . '/configs/translations/pt_BR.php';
$translate = new Zend_Translate('array', $translationStrings, 'pt');
$this->setTranslator($translate);
$this->addElementPrefixPath('FernandoMantoan_Validate', 'FernandoMantoan/Validate/', 'validate');
$this->setName('emprestimo');
$id = new Zend_Form_Element_Hidden('id');
$data_emprestimo = new Zend_Form_Element_Text('data_emprestimo');
$data_emprestimo->setLabel('Data do Empréstimo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Date');
$membroFacade = FernandoMantoan_DesignPatterns_Factory_FactoryFacade::createInstance(FernandoMantoan_DesignPatterns_Factory_FactoryFacade::FACADE_MEMBER);
$membros_options = $membroFacade->htmlselectBusiness();
$membro_id = new Zend_Form_Element_Select('membro_id');
$membro_id->addMultiOption('', 'Escolha um Membro');
if (sizeof($membros_options) > 0) {
foreach ($membros_options as $membro) {
$membro_id->addMultiOption($membro['id'], $membro['nome']);
}
}
$membro_id->setLabel('Membro:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$valor_juros = new Zend_Form_Element_Text('valor_juros');
$valor_juros->setLabel('Valor do Juros: R$')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Float');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Salvar')->setAttrib('id', 'submitbutton');
$this->addElements(array($id, $data_emprestimo, $membro_id, $valor_juros, $submit));
}
示例8: init
public function init()
{
$this->setName('destinatario')->setAttrib('class', 'form-horizontal');
$des_id_destinatario = new Zend_Form_Element_Hidden('des_id_destinatario');
$des_id_destinatario->addFilter('Int');
$des_nombre = new Zend_Form_Element_Text('des_nombre');
$des_nombre->setAttrib('placeholder', 'Nombre')->setLabel('Nombre:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_rut = new Zend_Form_Element_Text('des_rut');
$des_rut->setAttrib('placeholder', 'RUT')->setLabel('RUT:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_direccion = new Zend_Form_Element_Text('des_direccion');
$des_direccion->setAttrib('placeholder', 'Dirección')->setLabel('Dirección:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_ciudad = new Zend_Form_Element_Text('des_ciudad');
$des_ciudad->setAttrib('placeholder', 'Ciudad')->setLabel('Ciudad:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_telefono = new Zend_Form_Element_Text('des_telefono');
$des_telefono->setAttrib('placeholder', 'Teléfono')->setLabel('Teléfono:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_tipo = new Zend_Form_Element_Select('des_tipo');
$des_tipo->setAttrib('placeholder', 'Tipo')->setLabel('Tipo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$des_tipo->addMultiOption("CLIENTE", "Cliente");
$des_tipo->addMultiOption("PROVEEDOR", "Proveedor");
$des_tipo->addMultiOption("INTERNO", "Tienda SMO (Interno)");
$des_comuna = new Zend_Form_Element_Text('des_comuna');
$des_comuna->setAttrib('placeholder', 'Comuna')->setLabel('Comuna:')->addFilter('StripTags')->addFilter('StringTrim');
$des_region = new Zend_Form_Element_Text('des_region');
$des_region->setAttrib('placeholder', 'Región')->setLabel('Región:')->addFilter('StripTags')->addFilter('StringTrim');
$des_contacto = new Zend_Form_Element_Text('des_contacto');
$des_contacto->setAttrib('placeholder', 'Contacto')->setLabel('Contacto:')->addFilter('StripTags')->addFilter('StringTrim');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$this->addElements(array($des_id_destinatario, $des_nombre, $des_rut, $des_direccion, $des_ciudad, $des_telefono, $des_tipo, $des_comuna, $des_region, $des_contacto, $submit));
}
示例9: __construct
public function __construct($options = null)
{
parent::__construct();
$this->setName('layout_form');
$this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator');
$this->removeDecorator('Errors');
$this->removeDecorator('HtmlTag');
$this->removeDecorator('Label');
//$this->setAction($this->_generateActionUrl());
$layout_select = new Zend_Form_Element_Select('layout_select');
$layout_select->setAttrib('onchange', '$("#submitLayoutSelection").click();');
$layout_select->removeDecorator('Errors');
$layout_select->removeDecorator('Label');
$layout_select->removeDecorator('HtmlTag');
/*foreach($options as $language)
$translation_select->addMultiOption($language['iso6391_lng'], $language['name_lng']);
*/
$layout_select->addMultiOption('default', 'Default');
$layout_select->addMultiOption('custom', 'Custom');
//$layout_select->setValue($this->_getCurrentLayoutSelect());
$layout_select->setValue('default');
$submit = new Zend_Form_Element_Submit('submitLayoutSelection');
$submit->removeDecorator('DtDdWrapper');
$submit->setAttrib('style', 'display: none;');
$this->addElements(array($layout_select, $submit));
}
示例10: init
public function init()
{
require_once APPLICATION_PATH . '/configs/translations/pt_BR.php';
$translate = new Zend_Translate('array', $translationStrings, 'pt');
$this->setTranslator($translate);
$this->addElementPrefixPath('FernandoMantoan_Validate', 'FernandoMantoan/Validate/', 'validate');
$this->setName('itememprestimo');
$id = new Zend_Form_Element_Hidden('id');
$emprestimo_id = new Zend_Form_Element_Hidden('emprestimo_id');
$data_prevista = new Zend_Form_Element_Text('data_prevista');
$data_prevista->setLabel('Data para Devolução:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Date');
$livroFacade = FernandoMantoan_DesignPatterns_Factory_FactoryFacade::createInstance(FernandoMantoan_DesignPatterns_Factory_FactoryFacade::FACADE_BOOK);
$livros_options = $livroFacade->htmlselectBusiness();
$livro_isbn = new Zend_Form_Element_Select('livro_isbn');
$livro_isbn->addMultiOption('', 'Escolha um Livro');
if (sizeof($livros_options) > 0) {
foreach ($livros_options as $livro) {
$livro_isbn->addMultiOption($livro['isbn'], $livro['titulo']);
}
}
$livro_isbn->setLabel('Livro:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Adicionar Item')->setAttrib('id', 'submitbutton');
$this->addElements(array($id, $emprestimo_id, $data_prevista, $livro_isbn, $submit));
}
示例11: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('safcontrollers');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$label = new Zend_Form_Element_Text('label');
$label->setLabel('label');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('name');
$image = new Zend_Form_Element_Textarea('image');
$image->setLabel('image');
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel('description');
$safmodulesId = new Zend_Form_Element_Select('safmodules_id');
$options = new Safmodules();
$safmodulesId->addMultiOption('', '----------');
foreach ($options->fetchAlltoFlatArray() as $k => $v) {
$safmodulesId->addMultiOption($k, $v['mlabel']);
}
$safmodulesId->setLabel('safmodules_id');
$this->addElements(array($id, $hash, $label, $name, $image, $description, $safmodulesId));
$this->addElements(array($submit));
}
示例12: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('filfolders');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$label = new Zend_Form_Element_Text('label');
$label->setLabel('label');
$desc = new Zend_Form_Element_Textarea('desc');
$desc->setLabel('desc');
$parentId = new Zend_Form_Element_Select('parent_id');
$options = new Filfolders();
$parentId->addMultiOption('', '----------');
foreach ($options->fetchAlltoFlatArray() as $k => $v) {
$parentId->addMultiOption($k, $v['mlabel']);
}
$parentId->setLabel('parent_id');
$isnode = new Zend_Form_Element_Text('isnode');
$isnode->setLabel('isnode');
$isparam = new Zend_Form_Element_Text('isparam');
$isparam->setLabel('isparam');
$relevance = new Zend_Form_Element_Text('relevance');
$relevance->setLabel('relevance');
$pagorder = new Zend_Form_Element_Text('pagorder');
$pagorder->setLabel('pagorder');
$linkedto = new Zend_Form_Element_Textarea('linkedto');
$linkedto->setLabel('linkedto');
$isSystemFolder = new Zend_Form_Element_Text('isSystemFolder');
$isSystemFolder->setLabel('isSystemFolder');
$this->addElements(array($id, $hash, $label, $desc, $parentId, $isnode, $isparam, $relevance, $pagorder, $linkedto, $isSystemFolder));
$this->addElements(array($submit));
}
示例13: init
public function init()
{
$nameProject = new Zend_Form_Element_Text('nameProject');
$nameProject->setLabel('nom Projet')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$dateBegin = new Zend_Form_Element_Text('dateBegin');
$dateBegin->setLabel('à partir de :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$dateEnd = new Zend_Form_Element_Text('dateEnd');
$dateEnd->setLabel('jusqu\'à le :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$budget = new Zend_Form_Element_Text('budget');
$budget->setLabel('Budget :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$localisation = new Zend_Form_Element_Select('localisation');
$localisation->setLabel('Localisation :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$cityModel = new City();
$selectReferenceForCity = $cityModel->select()->setIntegrityCheck(false)->from('city');
$localisation->addMultiOption(0, '-');
foreach ($cityModel->fetchAll($selectReferenceForCity) as $row) {
$localisation->addMultiOption($row->city_id, $row->city_description);
}
$domaine = new Zend_Form_Element_Select('domaine');
$domaine->setLabel('Domaine :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$reference = new ReferenceValue();
$selectReferenceForDomain = $reference->select()->setIntegrityCheck(false)->from('reference_values')->where('reference_values.reference_Id=5');
$domaine->addMultiOption(0, '-');
foreach ($reference->fetchAll($selectReferenceForDomain) as $row) {
$domaine->addMultiOption($row->value_id, $row->name);
}
$statut = new Zend_Form_Element_Select('statut');
$statut->setLabel('statut :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$statut->addMultiOptions(array('1' => 'encours', '2' => 'valide', '3' => 'suspendu'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Filter'), 'required' => true));
$this->setCancelLink(false);
$this->addElements(array($nameProject, $dateBegin, $dateEnd, $budget, $localisation, $domaine, $statut, $submit));
}
示例14: init
/**
* Creates the form to create a new case.
* @see Zend_Form::init()
*/
public function init()
{
$em = Zend_Registry::getInstance()->entitymanager;
$this->setMethod('post');
$sexElement = new Zend_Form_Element_Select('sex');
$sexElement->setLabel("Geschlecht");
$sexElement->addMultiOption("", "Bitte wählen");
$sexElement->addMultiOption("male", "männlich");
$sexElement->addMultiOption("female", "weiblich");
$sexElement->setRequired(true);
$firstnameElement = new Zend_Form_Element_Text('firstname');
$firstnameElement->setLabel("Vorname");
$firstnameElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$firstnameElement->addValidator('stringLength', false, array(2, 64));
$firstnameElement->setRequired(true);
$lastnameElement = new Zend_Form_Element_Text('lastname');
$lastnameElement->setLabel("Nachname");
$lastnameElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$lastnameElement->addValidator('stringLength', false, array(2, 64));
$lastnameElement->setRequired(true);
$birthdayElement = new Zend_Form_Element_Text('birthday');
$birthdayElement->setLabel("Geburtstag");
$birthdayElement->addValidator(new Zend_Validate_Date());
$sizeElement = new Zend_Form_Element_Text('size');
$sizeElement->setLabel("Körpergröße in cm");
$sizeElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$sizeElement->addValidator('stringLength', false, array(2, 64));
$weightElement = new Zend_Form_Element_Text('weight');
$weightElement->setLabel("Gewicht in kg");
$weightElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$weightElement->addValidator('stringLength', false, array(2, 64));
$bloodGroupElement = new Zend_Form_Element_Text('bloodGroup');
$bloodGroupElement->setLabel("Blutgruppe");
$bloodGroupElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$bloodGroupElement->addValidator('stringLength', false, array(2, 64));
$streetElement = new Zend_Form_Element_Text('street');
$streetElement->setLabel("Straße");
$streetElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$streetElement->addValidator('stringLength', false, array(2, 64));
$zipcodeElement = new Zend_Form_Element_Text('zipcode');
$zipcodeElement->setLabel("Postleitzahl");
$zipcodeElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$zipcodeElement->addValidator('stringLength', false, array(2, 64));
$cityElement = new Zend_Form_Element_Text('city');
$cityElement->setLabel("Stadt");
$cityElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
$cityElement->addValidator('stringLength', false, array(2, 64));
$submitElement = new Zend_Form_Element_Submit('submit');
$submitElement->setLabel('Speichern');
$submitElement->setIgnore(true);
$submitElement->setAttrib('class', 'submit');
$submitElement->removeDecorator('DtDdWrapper');
$this->addElements(array($firstnameElement, $lastnameElement, $sizeElement, $weightElement, $bloodGroupElement, $streetElement, $zipcodeElement, $cityElement, $sexElement, $birthdayElement));
$this->addDisplayGroup(array('sex', 'firstname', 'lastname', 'birthday'), 'informationGroup', array('legend' => 'Allgemeine Informationen'));
$this->addDisplayGroup(array('size', 'weight', 'bloodGroup'), 'vitalGroup', array('legend' => 'Vital Informationen'));
$this->addDisplayGroup(array('street', 'zipcode', 'city'), 'addressGroup', array('legend' => 'Adresse'));
$this->addElements(array($submitElement));
}
示例15: _status
/**
* Status Combobox
*
* @return Zend_Form_Element_Select
*/
protected function _status()
{
$element = new Zend_Form_Element_Select('status');
$element->setLabel('Status')->setRequired(true)->setAttribs(array('class' => 'span3'));
$element->addMultiOption(Blog_Model_Post::STATUS_DRAFT, 'Draft');
$element->addMultiOption(Blog_Model_Post::STATUS_PUBLISHED, 'Published');
$element->addMultiOption(Blog_Model_Post::STATUS_DELETED, 'Deleted');
return $element;
}