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


PHP Form::remove方法代碼示例

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


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

示例1: getForm

 /**
  * {@inheritDoc}
  */
 public function getForm()
 {
     $currentStep = $this->getCurrentStep();
     if (!$currentStep) {
         return;
     }
     if (null === $this->form) {
         $this->form = $this->formFactory->create();
         $this->form->setAttribute('action', sprintf('?%s=%s', $this->getOptions()->getTokenParamName(), $this->getUniqueId()));
         if (!$this->getSteps()->getPrevious($currentStep)) {
             $this->form->remove('previous');
         }
         if (!$this->getSteps()->getNext($currentStep)) {
             $this->form->remove('next');
         } else {
             $this->form->remove('valid');
         }
     }
     $stepForm = $currentStep->getForm();
     if ($stepForm instanceof Form) {
         if ($this->form->has(self::STEP_FORM_NAME)) {
             $this->form->remove(self::STEP_FORM_NAME);
         }
         $stepForm->setName(self::STEP_FORM_NAME);
         $stepForm->populateValues($currentStep->getData());
         $this->form->add($stepForm);
     }
     return $this->form;
 }
開發者ID:Tribalx,項目名稱:Wizard,代碼行數:32,代碼來源:Wizard.php

示例2: getNoteForm

 /**
  * @param Entity\Note $note
  * @param string $url
  * @param string $action
  * @param array $members
  * @return \Zend\Form\Form
  */
 public function getNoteForm(Entity\Note $note, $url = '', $action = 'add', $members = null)
 {
     if (is_null($this->noteForm)) {
         $builder = new AnnotationBuilder($this->getEntityManager());
         $this->noteForm = $builder->createForm($note);
         $this->noteForm->setAttribute('action', $url);
         $this->noteForm->setAttribute('id', 'noteForm');
         $this->noteForm->setHydrator(new DoctrineObject($this->getEntityManager(), 'Secretary\\Entity\\Note'));
         $this->noteForm->bind($note);
         if ($action == 'edit' && $note->getPrivate() === false) {
             $this->noteForm->remove('private');
             $group = $note->getGroup();
             $membersString = $this->getMembersString(array_keys($members));
             $this->noteForm->get('groupHidden')->setValue($group->getId());
             $this->noteForm->get('members')->setValue($membersString);
             $this->noteForm->getInputFilter()->remove('__initializer__');
             $this->noteForm->getInputFilter()->remove('__cloner__');
             $this->noteForm->getInputFilter()->remove('__isInitialized__');
             $this->noteForm->getInputFilter()->remove('lazyPropertiesDefaults');
         } else {
             $this->noteForm->get('private')->setAttribute('required', false);
             $this->noteForm->getInputFilter()->get('private')->setRequired(false);
         }
     }
     return $this->noteForm;
 }
開發者ID:dotuancd,項目名稱:secretary,代碼行數:33,代碼來源:Note.php

示例3: fixUserForm

 /**
  * @param \Zend\Form\Form $form
  */
 protected function fixUserForm(Form &$form, $userId = null)
 {
     $auth = $this->getAuthenticationService();
     $groupId = $form->get('groupId');
     $groups = $groupId->getValueOptions();
     if (empty($groups) || $auth->getIdentity()->id == $userId) {
         $form->remove('groupId');
     }
 }
開發者ID:gridguyz,項目名稱:core,代碼行數:12,代碼來源:AdminController.php

示例4: testAddRemove

 public function testAddRemove()
 {
     $form = clone $this->form;
     $this->assertEquals($form, $this->form);
     $file = new Element\File('file_resource');
     $this->form->add($file);
     $this->assertTrue($this->form->has('file_resource'));
     $this->assertNotEquals($form, $this->form);
     $this->form->remove('file_resource');
     $this->assertEquals($form, $this->form);
 }
開發者ID:rajanlamic,項目名稱:IntTest,代碼行數:11,代碼來源:FormTest.php

示例5: remove

 /**
  * Override Form remove function to perform additional operations
  * @param string $element
  */
 public function remove($element)
 {
     unset($this->rawElements[$element]);
     return parent::remove($element);
 }
開發者ID:BanterMediaSA,項目名稱:majestic3-open-source,代碼行數:9,代碼來源:MajesticExternalFormBase.php

示例6: remove

 /**
  * {@inheritDoc}
  */
 public function remove($elementOrFieldset)
 {
     if (!parent::has($elementOrFieldset)) {
         if ($elementOrFieldset === 'captcha') {
             $elementOrFieldset = $this->getCaptchaElementName();
         } elseif ($elementOrFieldset === 'csrf') {
             $elementOrFieldset = $this->getCsrfElementName();
         }
     }
     return parent::remove($elementOrFieldset);
 }
開發者ID:coolms,項目名稱:common,代碼行數:14,代碼來源:Form.php

示例7: removeFormElement

 /**
  *
  * @param type $elementName
  * @throws Exception
  */
 public function removeFormElement($elementName)
 {
     if (!$this->isLoadCrudSettings()) {
         return false;
     }
     if (!$this->frmMainCrud instanceof \Zend\Form\Form) {
         throw new Exception('You must define a Form object', $code, $previous);
     }
     if (!$priority) {
         $priority = $this->frmMainCrud->get($elementName)->getOption('priority');
     }
     $this->frmMainCrud->remove($elementName);
     return true;
 }
開發者ID:renatosalvatori,項目名稱:Zf2datatable,代碼行數:19,代碼來源:Datagrid.php

示例8: addSubmitButton

 public function addSubmitButton(Form $subForm)
 {
     $subForm->remove("btnSalvar");
     $subForm->add(['type' => 'Button', 'name' => 'btnSalvar', 'attributes' => ['class' => 'btn btn-default', 'type' => 'button'], 'options' => ['label' => 'Salvar e Continuar']]);
     return $this;
 }
開發者ID:argentinaluiz,項目名稱:js_zf2_library,代碼行數:6,代碼來源:MultiPageForm.php


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