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


PHP Zend_Form_Element_Text::setLabel方法代码示例

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


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

示例1: setUp

 /**
  * See {@link PHPUnit_Framework_TestCase::setUp()} for details.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->relationValidator = $this->createRelationValidator();
     $this->element = new Zend_Form_Element_Text('name');
     $this->element->setLabel('Your name');
     $this->validator = new Mol_Validate_Form_ElementRelation($this->relationValidator, $this->element);
 }
开发者ID:matthimatiker,项目名称:molcomponents,代码行数:11,代码来源:ElementRelationTest.php

示例2: init

 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('album');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $artist = new Zend_Form_Element_Text('artist');
     $artist->setLabel('Artist')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty');
     $title = new Zend_Form_Element_Text('title');
     $artist->setLabel('Title')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $this->addElements(array($id, $artist, $title, $submit));
 }
开发者ID:ttvi-cse,项目名称:zf-tutorial,代码行数:14,代码来源:Album.php

示例3: init

 public function init()
 {
     $languageFile = Zend_Registry::get('languageFile');
     $translate = new Zend_Translate('array', $languageFile, 'zh_CN');
     $this->setTranslator($translate);
     $this->setMethod('POST');
     $this->setName('contactForm');
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('怎么称呼您');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('email');
     $element->setLabel('您的Email');
     //$element->setRequired(true);
     $this->addElement($element);
     $element = new Elements();
     $element->addReCaptcha($this);
     $this->addDisplayGroup(array('name', 'email', 'captcha'), 'leftSection');
     $this->getDisplayGroup('leftSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Textarea('body');
     $element->setLabel('想要开通城市地区和找房贴士,关于您的简单介绍');
     $element->addPrefixPath('My_Validator', 'My/Validator/', 'validate');
     $element->addValidator('FormValueNotNull', true);
     //$element->setRequired(true);
     $element->setAttrib('rows', 13);
     $this->addElement($element);
     $this->addDisplayGroup(array('body'), 'rightSection');
     $this->getDisplayGroup('rightSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Submit('post');
     $element->removeDecorator('Label');
     $this->addElement($element);
 }
开发者ID:BGCX262,项目名称:zufangzi-svn-to-git,代码行数:31,代码来源:AddNewCity.php

示例4: init

 public function init()
 {
     $this->clearDecorators()->addDecorator('FormElements')->addDecorator('Form')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'search'))->addDecorator('HtmlTag2', array('tag' => 'div', 'class' => 'clear'));
     $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setMethod('GET');
     $displayname = new Zend_Form_Element_Text('displayname');
     $displayname->setLabel('Display Name')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $username = new Zend_Form_Element_Text('username');
     $username->setLabel('Username')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $levels = Engine_Api::_()->getDbtable('levels', 'authorization')->getLevelsAssoc();
     $levelMultiOptions = array(0 => ' ');
     foreach ($levels as $key => $value) {
         $levelMultiOptions[$key] = $value;
     }
     $level_id = new Zend_Form_Element_Select('level_id');
     $level_id->setLabel('Level')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions($levelMultiOptions);
     $enabled = new Zend_Form_Element_Select('enabled');
     $enabled->setLabel('Approved')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions(array('-1' => '', '0' => 'Not Approved', '1' => 'Approved'))->setValue('-1');
     $submit = new Zend_Form_Element_Button('search', array('type' => 'submit'));
     $submit->setLabel('Search')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))->addDecorator('HtmlTag2', array('tag' => 'div'));
     $this->addElement('Hidden', 'order', array('order' => 10001));
     $this->addElement('Hidden', 'order_direction', array('order' => 10002));
     $this->addElement('Hidden', 'user_id', array('order' => 10003));
     $this->addElements(array($displayname, $username, $email, $level_id, $enabled, $submit));
     // Set default action without URL-specified params
     $params = array();
     foreach (array_keys($this->getValues()) as $key) {
         $params[$key] = null;
     }
     $this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble($params));
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:32,代码来源:Filter.php

示例5: __construct

 /** the constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('moneyers');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Moneyer\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a moneyer\'s name');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options));
     $date_1 = new Zend_Form_Element_Text('date_1');
     $date_1->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the start of moneyer period');
     $date_2 = new Zend_Form_Element_Text('date_2');
     $date_2->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the end of moneyer period');
     $appear = new Zend_Form_Element_Text('appear');
     $appear->setLabel('Appearance on coins: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $RRC = new Zend_Form_Element_Text('RRC');
     $RRC->setLabel('RRC ID number: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $bio = new Pas_Form_Element_CKEditor('bio');
     $bio->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($period, $name, $date_1, $date_2, $bio, $appear, $RRC, $valid, $submit));
     $this->addDisplayGroup(array('name', 'period', 'date_1', 'date_2', 'appear', 'RRC', 'bio', 'valid', 'submit'), 'details');
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:32,代码来源:MoneyerForm.php

示例6: init

 public function init()
 {
     $this->setName('shipping_address');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $customerid = new Zend_Form_Element_Hidden('customerid');
     $customerid->addFilter('Int');
     $address1 = new Zend_Form_Element_Text('shipping_address1');
     $address1->setLabel('Street Address')->setAttrib('id', 'address1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $address2 = new Zend_Form_Element_Text('shipping_address2');
     $address2->setLabel('')->setAttrib('id', 'address2')->addFilter('StripTags')->addFilter('StringTrim');
     $address3 = new Zend_Form_Element_Text('shipping_address3');
     $address3->setLabel('')->setAttrib('id', 'address3')->addFilter('StripTags')->addFilter('StringTrim');
     $postcode = new Zend_Form_Element_Text('shipping_postcode');
     $postcode->setLabel('Postcode')->setAttrib('id', 'postcode')->addFilter('StripTags')->addFilter('StringTrim');
     $country = new Zend_Form_Element_Text('shipping_country');
     $country->setLabel('Country')->setAttrib('id', 'country')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $city = new Zend_Form_Element_Text('shipping_city');
     $city->setLabel('City')->setAttrib('id', 'city')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $phone = new Zend_Form_Element_Text('shipping_phone');
     $phone->setLabel('Phone')->setAttrib('id', 'phone')->addFilter('StripTags')->addFilter('StringTrim');
     $fax = new Zend_Form_Element_Text('shipping_fax');
     $fax->setLabel('Fax')->setAttrib('id', 'fax')->addFilter('StripTags')->addFilter('StringTrim');
     $email = new Zend_Form_Element_Text('shipping_email');
     $email->setLabel('E-Mail')->setAttrib('id', 'email')->addFilter('StripTags')->addFilter('StringTrim');
     $internet = new Zend_Form_Element_Text('shipping_internet');
     $internet->setLabel('Internet')->setAttrib('id', 'internet')->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Button('shipping_submit');
     $submit->setAttrib('onclick', 'addAddress()');
     $this->addElements(array($id, $customerid, $address1, $address2, $address3, $postcode, $city, $country, $phone, $fax, $email, $internet, $submit));
 }
开发者ID:dewawi,项目名称:dewawi,代码行数:31,代码来源:ShippingAddress.php

示例7: init

 public function init()
 {
     $this->clearDecorators()->addDecorator('FormElements')->addDecorator('Form')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'search'))->addDecorator('HtmlTag2', array('tag' => 'div', 'class' => 'clear'));
     $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'));
     $username = new Zend_Form_Element_Text('username');
     $username->setLabel('Username')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $levelMultiOptions = array(0 => ' ');
     /*      $table = $this->_helper->api()->getItemTable('user');
           $select = $viewer->membership()->getMembersSelect('user_id');
           $friends = $table->fetchAll($select);*/
     $levels = Engine_Api::_()->getDbtable('levels', 'authorization')->fetchAll();
     foreach ($levels as $row) {
         $levelMultiOptions[$row->level_id] = $row->getTitle();
     }
     $level_id = new Zend_Form_Element_Select('level_id');
     $level_id->setLabel('Level')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions($levelMultiOptions);
     $enabled = new Zend_Form_Element_Select('enabled');
     $enabled->setLabel('Approved')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions(array('-1' => '', '0' => 'Not Approved', '1' => 'Approved'))->setValue('-1');
     $submit = new Zend_Form_Element_Button('search', array('type' => 'submit'));
     $submit->setLabel('Search')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))->addDecorator('HtmlTag2', array('tag' => 'div'));
     $this->addElement('Hidden', 'order', array('order' => 10001));
     $this->addElement('Hidden', 'order_direction', array('order' => 10002));
     $this->addElements(array($username, $email, $level_id, $enabled, $submit));
     // Set default action
     $this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
 }
开发者ID:robeendey,项目名称:ce,代码行数:28,代码来源:Filter.php

示例8: init

    public function init()
    {
        $tr = Zend_Registry::get('tr');
        
        $handle = new Zend_Form_Element_Text('handle');
        $handle->setLabel($tr->_('HANDLE'));
        $handle->setRequired(true);
        $handle->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($handle);

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel($tr->_('PASSWORD'));
        $password->setRequired(true);
        $password->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($password);

        $password1 = new Zend_Form_Element_Password('password_again');
        $password1->setLabel($tr->_('RETYPE') . ' ' . $tr->_('PASSWORD'));
        $password1->setRequired(true);
        $password1->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($password1);

        $this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));

        parent::init();
    }
开发者ID:reith2004,项目名称:frapi,代码行数:26,代码来源:User.php

示例9: init

 public function init()
 {
     $this->setMethod('post');
     //$this->setAttrib('action',DOMAIN.'language/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'servicedeskdepartment');
     $id = new Zend_Form_Element_Hidden('id');
     $servicedeskdepartment = new Zend_Form_Element_Text("service_desk_name");
     $servicedeskdepartment->setLabel("Category");
     $servicedeskdepartment->setAttrib('maxLength', 30);
     $servicedeskdepartment->addFilter(new Zend_Filter_StringTrim());
     $servicedeskdepartment->setRequired(true);
     $servicedeskdepartment->addValidator('NotEmpty', false, array('messages' => 'Please enter category.'));
     $servicedeskdepartment->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9\\- ]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid category.')));
     $servicedeskdepartment->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_sd_depts', 'field' => 'service_desk_name', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND isactive=1')));
     $servicedeskdepartment->getValidator('Db_NoRecordExists')->setMessage('Category name already exists.');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel("Description");
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $servicedeskdepartment, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:27,代码来源:servicedeskdepartment.php

示例10: _periodo_submissao_fim

 protected function _periodo_submissao_fim()
 {
     $e = new Zend_Form_Element_Text('periodo_submissao_fim');
     $e->setLabel(_('Submission ends in') . ":")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'form-control date');
     $e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
     return $e;
 }
开发者ID:jovanepires,项目名称:sige,代码行数:7,代码来源:Encontro.php

示例11: init

 public function init()
 {
     $country_code = new Zend_Form_Element_Text('country_code');
     $country_code->setLabel('Country code');
     $country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html');
     $country_code->setRequired(true);
     $this->addElement($country_code);
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name');
     $name->setRequired(true);
     $this->addElement($name);
     $is_active = new Zend_Form_Element_Checkbox('is_active');
     $is_active->setLabel('Active');
     $is_active->setRequired(true);
     $this->addElement($is_active);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black');
     $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/languages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
开发者ID:zelimirus,项目名称:yard,代码行数:25,代码来源:Languages.php

示例12: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('applog');
     $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');
     $timestamp = new Zend_Form_Element_Text('timestamp');
     $timestamp->setLabel('timestamp');
     $priorityName = new Zend_Form_Element_Text('priorityName');
     $priorityName->setLabel('priorityName');
     $priority = new Zend_Form_Element_Text('priority');
     $priority->setLabel('priority');
     $className = new Zend_Form_Element_Text('className');
     $className->setLabel('className');
     $message = new Zend_Form_Element_Textarea('message');
     $message->setLabel('message');
     $identity = new Zend_Form_Element_Text('identity');
     $identity->setLabel('identity');
     $httpReferer = new Zend_Form_Element_Textarea('HTTP_REFERER');
     $httpReferer->setLabel('HTTP_REFERER');
     $remoteAddr = new Zend_Form_Element_Text('REMOTE_ADDR');
     $remoteAddr->setLabel('REMOTE_ADDR');
     $requestMethod = new Zend_Form_Element_Text('REQUEST_METHOD');
     $requestMethod->setLabel('REQUEST_METHOD');
     $requestTime = new Zend_Form_Element_Text('REQUEST_TIME');
     $requestTime->setLabel('REQUEST_TIME');
     $mysqltimestamp = new Zend_Form_Element_Text('mysqltimestamp');
     $mysqltimestamp->setLabel('mysqltimestamp');
     $elements = array($id, $hash, $timestamp, $priorityName, $priority, $className, $message, $identity, $httpReferer, $remoteAddr, $requestMethod, $requestTime, $mysqltimestamp);
     $this->addElements($elements);
     $this->addElements(array($submit));
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:35,代码来源:ApplogForm.php

示例13: init

 /**
  * Initializing form
  */
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Select('year');
     $element->setLabel('Jaar')->addMultiOption('', '...')->setDescription('Percentages zijn van toepassing op dit jaartal')->setRequired(true);
     $entries = Model_Hm_Week_Percentage::findAllByHomeId($this->getHomeId())->select('wp.year, wp.id, wp.hm_home_id')->execute(null, Doctrine_Core::HYDRATE_ARRAY);
     $availableYears = new Model_Hm_AvailableYears($entries);
     foreach ($availableYears->toArray() as $year) {
         $element->addMultiOption($year, $year);
     }
     $this->addElement($element);
     $this->addDisplayGroup(array('year'), 'year-group', array('legend' => 'Algemeen', 'class' => 'width100'));
     for ($weekNo = 01; $weekNo <= 53; $weekNo++) {
         $elementName = 'week_' . $weekNo;
         $elements[] = $elementName;
         $element = new Zend_Form_Element_Text($elementName);
         $element->setLabel('Percentage')->setValidators(array(array('Float')))->setAttribs(array('maxlength' => 6))->setRequired(true);
         $this->addElement($element);
         $this->addDisplayGroup(array($elementName), $elementName . 'group', array('class' => 'weekpercentage', 'legend' => 'Week ' . $weekNo));
     }
     $element = new Zend_Form_Element_Submit('submit_percentageweek');
     $element->setLabel('Verwerken')->setAttrib('class', 'submit');
     $this->addElement($element);
     $this->addDisplayGroup(array('submit_percentageweek'), 'submit', array('class' => 'submit'));
     $this->bhvkDecorators();
     $this->bhvkDecorateSubmitElement($this->getElement('submit_percentageweek'));
 }
开发者ID:jaspermeijaard,项目名称:home-booking-system,代码行数:30,代码来源:Percentageweek.php

示例14: 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);
     $oFormSliderEditId = new Zend_Form_Element_Hidden("slider_edit_id");
     $oFormSliderEditId->setValue(0);
     $oFormSliderEditId->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormSliderEditId);
     $oSliderName = new Zend_Form_Element_Text("name");
     $oSliderName->setLabel("Nazwa slidera:");
     $oSliderName->addValidator(new Zend_Validate_StringLength(array("min" => 3, "max" => 45)));
     $oSliderName->setRequired(TRUE);
     $oSliderName->setAttrib("class", "valid");
     $this->addElement($oSliderName);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $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");
     }
 }
开发者ID:lstaszak,项目名称:zf_zk_aleph,代码行数:34,代码来源:AddSlider.php

示例15: init

 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     // TODO setMethod
     $element = new Zend_Form_Element_Text('prenom');
     $element->setLabel('Prénom')->setRequired();
     $validator = new Zend_Validate_NotEmpty();
     $validator->setMessage('Le prénom est obligatoire', Zend_Validate_NotEmpty::IS_EMPTY);
     $element->addValidator($validator);
     $validator = new Zend_Validate_StringLength();
     $validator->setMax(40);
     $element->addValidator($validator);
     $filter = new Zend_Filter_StringTrim();
     $element->addFilter($filter);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('nom');
     $element->setLabel('Nom')->setRequired();
     $validator = new Zend_Validate_NotEmpty();
     $validator->setMessage('Le nom est obligatoire', Zend_Validate_NotEmpty::IS_EMPTY);
     $element->addValidator($validator);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('email');
     $element->setLabel('Email');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('telephone');
     $element->setLabel('Téléphone');
     $this->addElement($element);
 }
开发者ID:bioub,项目名称:Formation_ZF1_Viveris_2016_02,代码行数:28,代码来源:Contact.php


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