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


PHP Form::bindOnValidate方法代码示例

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


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

示例1: getForm

 /**
  * @return \Zend\Form\Form
  */
 public function getForm($entity)
 {
     if ($this->form->hasValidated()) {
         return $this->form;
     }
     $this->form->bind($entity);
     $this->form->bindOnValidate();
     $this->getEventManager()->trigger($this->createEvent(CrudEvent::FORM_READY, $this->form));
     return $this->form;
 }
开发者ID:phpro,项目名称:zf-smartcrud,代码行数:13,代码来源:AbstractSmartService.php

示例2: testCanDisableBindOnValidateFunctionality

 public function testCanDisableBindOnValidateFunctionality()
 {
     $this->form->setBindOnValidate(false);
     $this->assertFalse($this->form->bindOnValidate());
 }
开发者ID:benivaldo,项目名称:zf2-na-pratica,代码行数:5,代码来源:FormTest.php

示例3: it_should_handle_valid_data

 /**
  * @param \Phpro\SmartCrud\Gateway\CrudGatewayInterface $gateway
  * @param \Zend\EventManager\EventManager               $eventManager
  * @param \Zend\Form\Form                               $form
  * @param \Phpro\SmartCrud\Service\SmartServiceResult   $result
  */
 public function it_should_handle_valid_data($gateway, $eventManager, $form, $result)
 {
     $entity = new \StdClass();
     $entity->id = 1;
     $postData = $this->getMockPostData();
     $gateway->loadEntity('entityKey', $entity->id)->shouldBecalled()->willReturn($entity);
     $gateway->update($entity, $postData)->shouldBecalled()->willReturn(true);
     $form->hasValidated()->shouldBeCalled()->willreturn(false);
     $form->bind(Argument::any())->shouldBeCalled();
     $form->bindOnValidate()->shouldBeCalled();
     $form->setData(Argument::exact($this->getMockPostData()))->shouldBeCalled()->willReturn($form);
     $form->isValid()->shouldBeCalled()->willreturn(true);
     $result->setSuccess(true)->shouldBeCalled();
     $result->setForm($form)->shouldBeCalled();
     $result->setEntity($entity)->shouldBeCalled();
     $this->setEntityKey('entityKey');
     $this->setGateway($gateway);
     $this->setForm($form);
     $this->setResult($result);
     $this->run($entity->id, $this->getMockPostData())->shouldReturn($result);
     $eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_HYDRATION))->shouldBeCalled();
     $eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldBeCalled();
     $eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_UPDATE))->shouldNotBeCalled();
     $eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_UPDATE))->shouldBeCalled();
     $eventManager->trigger(Argument::which('getName', CrudEvent::AFTER_UPDATE))->shouldBeCalled();
 }
开发者ID:phpro,项目名称:zf-smartcrud,代码行数:32,代码来源:UpdateServiceSpec.php


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