当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Button::getDecorator方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Button::getDecorator方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Button::getDecorator方法的具体用法?PHP Zend_Form_Element_Button::getDecorator怎么用?PHP Zend_Form_Element_Button::getDecorator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Button的用法示例。


在下文中一共展示了Zend_Form_Element_Button::getDecorator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTranslatedLabelIsRendered

 public function testTranslatedLabelIsRendered()
 {
     $this->_checkZf2794();
     $this->testGetLabelReturnsTranslatedLabelIfTranslatorIsRegistered();
     $this->element->setView($this->getView());
     $decorator = $this->element->getDecorator('ViewHelper');
     $decorator->setElement($this->element);
     $html = $decorator->render('');
     $this->assertRegexp('/<(input|button)[^>]*?>Submit Button/', $html, $html);
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:10,代码来源:ButtonTest.php

示例2: __construct


//.........这里部分代码省略.........
     $identifier1ID = new Zend_Form_Element_Hidden('identifier1ID');
     $identifier1ID->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(27);
     $id2by = new Zend_Form_Element_Text('id2by');
     $id2by->setLabel('Secondary Identifier: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(28);
     //Secondary Identifier
     $identifier2ID = new Zend_Form_Element_Hidden('identifier2ID');
     $identifier2ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(29);
     ## DISCOVERER DETAILS ##
     //Finder
     $finder1ID = new Zend_Form_Element_Hidden('finder1ID');
     $finder1ID->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(30);
     $hiddenfield = new Zend_Form_Element_Hidden('hiddenfield');
     $hiddenfield->setValue(2)->setOrder(31);
     $finder1 = new Zend_Form_Element_Text('finder1');
     $finder1->setLabel('Found by: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setDescription('To make a new finder/identifier appear, you ' . 'first need to create them from the people menu on ' . 'the left hand side')->setOrder(32);
     $addFinderButton = new Zend_Form_Element_Button('addFinder');
     $addFinderButton->setLabel('Add Additional Finder')->setAttribs(array('class' => 'btn btn-info'));
     $addFinderButton->setOrder(50);
     $removeFinderButton = new Zend_Form_Element_Button('removeFinder');
     $removeFinderButton->setLabel('Remove Last Finder')->setAttribs(array('class' => 'btn btn-warning hidden'));
     $removeFinderButton->setOrder(51);
     ## DISCOVERY INFORMATION ##
     //Discovery method
     $discmethod = new Zend_Form_Element_Select('discmethod');
     $discmethod->setLabel('Discovery method: ')->setRequired(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->addValidator('inArray', true, array(array_keys($disc_options)))->addMultiOptions(array(null => 'Choose method of discovery', 'Available methods' => $disc_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(52);
     //Discovery circumstances
     $disccircum = new Zend_Form_Element_Text('disccircum');
     $disccircum->setLabel('Discovery circumstances: ')->setAttrib('size', 50)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(53);
     //Date found from
     $datefound1 = new Zend_Form_Element_Text('datefound1');
     $datefound1->setLabel('First discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(54);
     //Date found to
     $datefound2 = new Zend_Form_Element_Text('datefound2');
     $datefound2->setLabel('Second discovery date: ')->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(55);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setCheckedValue('1')->setUncheckedValue(null)->addFilters(array('StripTags', 'StringTrim', 'Null'))->addValidator('Int')->setOrder(56);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options)))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addValidator('Int')->setOrder(57);
     ## OTHER REFERENCE NUMBERS ##
     //Legacy hoard ID
     $legacy_ref = new Zend_Form_Element_Text('legacyID');
     $legacy_ref->setLabel('Legacy hoard ID: ')->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(58)->disabled = true;
     //Other reference number
     $other_ref = new Zend_Form_Element_Text('other_ref');
     $other_ref->setLabel('Other reference: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(59);
     //HER reference number
     $smrrefno = new Zend_Form_Element_Text('smrrefno');
     $smrrefno->setLabel('Historic Environment Record number: ')->setAttrib('size', 30)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(60);
     //Museum accession number
     $musaccno = new Zend_Form_Element_Text('musaccno');
     $musaccno->setLabel('Museum accession number: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(61);
     //Current location of object
     $curr_loc = new Zend_Form_Element_Text('curr_loc');
     $curr_loc->setLabel('Current location: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setOrder(62);
     //Current location of object
     $subs_action = new Zend_Form_Element_Select('subs_action');
     $subs_action->setLabel('Subsequent action: ')->addFilters(array('StripTags', 'StringTrim', 'Null'))->setAttrib('class', 'span6')->addMultiOptions(array(null => 'Choose a subsequent action', 'Available options' => $actionsDD))->setValue(1)->addValidator('InArray', false, array(array_keys($actionsDD)))->addValidator('Int')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->setOrder(63);
     ## Quantities ##
     $quantityCoins = new Zend_Form_Element_Text('quantityCoins');
     $quantityCoins->setLabel('Quantity of coins: ')->addValidator('Int')->setValue(null);
     $quantityArtefacts = new Zend_Form_Element_Text('quantityArtefacts');
     $quantityArtefacts->setLabel('Quantity of artefacts: ')->addValidator('Int')->setValue(null);
     $quantityContainers = new Zend_Form_Element_Text('quantityContainers');
     $quantityContainers->setLabel('Quantity of containers: ')->addValidator('Int')->setValue(null);
     ## SUBMIT BUTTON ##
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOrder(67);
     $this->addElements(array($secuid, $old_hoardID, $broadperiod, $hoardperiod1, $hoardperiod2, $hoardsubperiod1, $hoardsubperiod2, $numdate1, $numdate2, $lastruler, $lastreeceperiod, $terminaldate1, $terminaldate2, $terminalreason, $description, $notes, $coindataquality, $findofnote, $findofnotereason, $treasure, $treasureID, $quantityArtefacts, $quantityCoins, $quantityContainers, $materials, $recorderID, $recordername, $idBy, $id2by, $identifier1ID, $identifier2ID, $finder1, $finder1ID, $hiddenfield, $addFinderButton, $removeFinderButton, $discmethod, $disccircum, $datefound1, $datefound2, $rally, $rallyID, $legacy_ref, $other_ref, $smrrefno, $musaccno, $curr_loc, $subs_action, $submit));
     $this->addDisplayGroup(array('broadperiod', 'subperiod1', 'period1', 'subperiod2', 'period2', 'numdate1', 'numdate2'), 'hoarddating');
     $this->hoarddating->setLegend('Hoard dating');
     $this->addDisplayGroup(array('lastrulerID', 'reeceID', 'terminalyear1', 'terminalyear2', 'terminalreason'), 'coindating');
     $this->coindating->setLegend('Coin dating');
     $this->addDisplayGroup(array('description', 'notes', 'qualityrating', 'findofnote', 'findofnotereason', 'treasure', 'treasureID'), 'hoarddetails');
     $this->hoarddetails->setLegend('Hoard details');
     $this->addDisplayGroup(array('quantityCoins', 'quantityArtefacts', 'quantityContainers'), 'quantities');
     $this->quantities->setLegend('Quantities');
     $this->addDisplayGroup(array('materials'), 'primarymaterials');
     $this->primarymaterials->setLegend('Materials');
     $this->addDisplayGroup(array('recordername', 'recorderID', 'idBy', 'identifier1ID', 'id2by', 'identifier2ID'), 'recorders');
     $this->recorders->setLegend('Recording details');
     $this->addDisplayGroup(array('finder1', 'finder1ID', 'hiddenfield', 'addFinder', 'removeFinder'), 'discoverers');
     $this->discoverers->setLegend('Discoverer details');
     $this->addDisplayGroup(array('disccircum', 'discmethod', 'datefound1', 'datefound2', 'rally', 'rallyID'), 'discovery');
     $this->discovery->setLegend('Discovery details');
     $this->addDisplayGroup(array('legacyID', 'other_ref', 'smrrefno', 'musaccno', 'curr_loc', 'subs_action'), 'references');
     $this->references->setLegend('Reference numbers');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
     $addFinderButton->removeDecorator('Label');
     $addFinderButtonDecorator = $addFinderButton->getDecorator('HtmlTag');
     $addFinderButtonDecorator->setOption('id', 'addFinderDiv');
     $removeFinderButton->removeDecorator('Label');
     $person = new Pas_User_Details();
     $role = $person->getRole();
     $projectTeam = array('hoard', 'admin');
     if (!in_array($role, $projectTeam)) {
         $coindataquality->disabled = true;
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:101,代码来源:HoardForm.php


注:本文中的Zend_Form_Element_Button::getDecorator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。