当前位置: 首页>>代码示例>>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;未经允许,请勿转载。