當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Submit::setIgnore方法代碼示例

本文整理匯總了PHP中Zend\Form\Element\Submit::setIgnore方法的典型用法代碼示例。如果您正苦於以下問題:PHP Submit::setIgnore方法的具體用法?PHP Submit::setIgnore怎麽用?PHP Submit::setIgnore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Form\Element\Submit的用法示例。


在下文中一共展示了Submit::setIgnore方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     $this->setMethod('POST');
     $element = new Element\Text('title');
     $element->setLabel('Title:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Select('name');
     $element->setLabel('Directory:');
     $element->setRequired(true);
     $element->addMultiOptions($this->model->getThemesDirectoriesFromFS());
     $this->addElement($element);
     $element = new Element\Radio('active');
     $element->setSeparator(' ');
     $element->setLabel('Active:');
     $element->setValue(false);
     $element->setMultiOptions(array('1' => 'Yes', '0' => 'No'));
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('ordering');
     $element->setLabel('Ordering:');
     $element->setRequired(true);
     $this->addElement($element);
     $element = new Element\Submit('submit');
     $element->setLabel('Save');
     $element->setIgnore(true);
     $this->addElement($element);
 }
開發者ID:zendmaniacs,項目名稱:zly-templater,代碼行數:28,代碼來源:Theme.php

示例2: init

 /**
  * Form initialization
  */
 public function init()
 {
     $this->setMethod('POST');
     $themes = $this->model->getlist();
     $themesList = array();
     foreach ($themes as $theme) {
         $layoutsList = array();
         foreach ($theme->getLayouts() as $layout) {
             $layoutsList[$layout->getId()] = $layout->getTitle();
         }
         $themesList[$theme->getTitle()] = $layoutsList;
     }
     $element = new Element\Select('layout_id');
     $element->setLabel('Theme layout:')->addMultiOptions($themesList)->addDecorator('fieldset')->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('name');
     $element->setLabel('Widget name:')->setRequired(true);
     $this->addElement($element);
     $element = new Element\Text('placeholder');
     $element->setLabel('Position:')->setRequired(true);
     $this->addElement($element);
     $this->addDisplayGroup(array('placeholder', 'name'), 'place', array('order' => 2, 'legend' => 'Display options:'));
     if ($this->locator->instanceManager()->hasAlias('sysmap-service')) {
         $sysmapElement = $this->locator->get('sysmap-service')->getMapFormElement();
         if (!empty($sysmapElement)) {
             $actionNavigator = clone $sysmapElement;
             if ($actionNavigator instanceof \Zly\Form\Element\Tree) {
                 $actionNavigator->setName('map_id');
                 $actionNavigator->setRequired();
                 $actionNavigator->setLabel('Widget content provider action:');
                 $actionNavigator->addDisableCondition('level', new \Zend\Validator\LessThan(3));
                 $this->addElement($actionNavigator);
             }
             $displayNavigator = clone $sysmapElement;
             if ($displayNavigator instanceof \Zly\Form\Element\Tree) {
                 $displayNavigator->setName('widget_points');
                 $displayNavigator->setLabel('Widget display pages:');
                 $displayNavigator->setRequired();
                 $displayNavigator->setMultiple(true);
                 $this->addElement($displayNavigator);
             }
         }
     }
     $element = new Element\Text('ordering');
     $element->addValidator(new \Zend\Validator\Int())->setRequired(true)->setLabel('Ordering:')->setAttrib('style', 'width:50px;');
     $this->addElement($element);
     $element = new Element\Checkbox('published');
     $element->setLabel('Published:');
     $this->addElement($element);
     $this->addDisplayGroup(array('ordering', 'published'), 'other', array('legend' => 'Publishing options:'));
     $element = new Element\Hidden('module');
     $element->removeDecorator('Label')->removeDecorator('HtmlTag')->setValue($this->_defaultValue);
     $this->addElement($element);
     $element = new Element\Hidden('controller');
     $element->removeDecorator('Label')->setValue($this->_defaultValue)->removeDecorator('HtmlTag');
     $this->addElement($element);
     $element = new Element\Hidden('action');
     $element->removeDecorator('Label')->setValue($this->_defaultValue)->removeDecorator('HtmlTag');
     $this->addElement($element);
     $element = new Element\Submit('submit');
     $element->setLabel('Save');
     $element->setIgnore(true);
     $this->addElement($element);
     foreach ($this->getDisplayGroups() as $group) {
         $group->setDecorators(array('description', 'FormElements', 'fieldset'));
     }
     foreach ($this->getSubForms() as $group) {
         $group->setDecorators(array('description', 'FormElements', 'fieldset'));
     }
 }
開發者ID:zendmaniacs,項目名稱:zly-templater,代碼行數:73,代碼來源:Widget.php


注:本文中的Zend\Form\Element\Submit::setIgnore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。