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


PHP FormInterface::getInputFilter方法代码示例

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


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

示例1: loginTfaAction

 public function loginTfaAction()
 {
     if (!$this->authSession->identity) {
         return $this->redirect()->toRoute('login');
     }
     if ($this->getRequest()->isPost()) {
         $this->verifyCodeForm->setData($this->getRequest()->getPost());
         /** @var AccountInterface $account */
         $account = $this->zourceIdentity($this->authSession->identity)->getAccount();
         /** @var \ZourceUser\InputFilter\VerifyCode $inputFilter */
         $inputFilter = $this->verifyCodeForm->getInputFilter();
         $inputFilter->setOneTimePasswordType($account->getTwoFactorAuthenticationType());
         $inputFilter->setOneTimePasswordCode($account->getTwoFactorAuthenticationCode());
         if ($this->verifyCodeForm->isValid()) {
             $this->authSession->verified = true;
             return $this->redirectAfterLogin($account);
         }
     }
     return new ViewModel(['verifyCodeForm' => $this->verifyCodeForm]);
 }
开发者ID:zource,项目名称:zource,代码行数:20,代码来源:Authenticate.php

示例2: handleGetRequest

 /**
  * @param  FormInterface $form
  * @return bool|array
  */
 protected function handleGetRequest(FormInterface $form)
 {
     $container = $this->getSessionContainer();
     if (null === $container->post) {
         // No previous post, bail early
         unset($container->files);
         return false;
     }
     // Collect data from session
     $post = $container->post;
     $errors = $container->errors;
     $isValid = $container->isValid;
     unset($container->post);
     unset($container->errors);
     unset($container->isValid);
     // Fill form with the data first, collections may alter the form/filter structure
     $form->setData($post);
     // Remove File Input validators and filters on previously uploaded files
     // in case $form->isValid() or $form->bindValues() is run
     $inputFilter = $form->getInputFilter();
     $this->traverseInputs($inputFilter, $post, function ($input, $value) {
         if ($input instanceof FileInput) {
             $input->setAutoPrependUploadValidator(false)->setValidatorChain(new ValidatorChain())->setFilterChain(new FilterChain());
         }
         return $value;
     });
     // set previous state
     $form->isValid();
     // re-validate to bind values
     if (null !== $errors) {
         $form->setMessages($errors);
         // overwrite messages
     }
     $this->setProtectedFormProperty($form, 'isValid', $isValid);
     // force previous state
     // Clear previous files from session data if form was valid
     if ($isValid) {
         unset($container->files);
     }
     return $post;
 }
开发者ID:tillk,项目名称:vufind,代码行数:45,代码来源:FilePostRedirectGet.php

示例3: processFormData

 /**
  * @param FormInterface      $form
  * @param \Zend\Http\Request $request
  * @param AdminMenu          $adminMenu
  *
  * @return \Zend\Http\Response
  */
 private function processFormData(FormInterface $form, \Zend\Http\Request $request, AdminMenu $adminMenu)
 {
     $form->setInputFilter($form->getInputFilter());
     $form->setData($request->getPost());
     if ($form->isValid()) {
         $this->adminMenuTable->saveAdminMenu($adminMenu);
         $this->setLayoutMessages('«' . $adminMenu->getCaption() . '» ' . $this->translate('SAVE_SUCCESS'), 'success');
     }
     return $this->redirect()->toUrl('/admin/admin-menu');
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:17,代码来源:AdminMenuController.php

示例4: processFormData

 /**
  * @param FormInterface $form
  * @param Content       $content
  * @param array         $data
  *
  * @return void
  */
 private function processFormData(FormInterface $form, Content $content, array $data)
 {
     $form->setInputFilter($form->getInputFilter());
     $form->setData($data);
     $this->saveFormData($form, $content);
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:13,代码来源:ContentController.php


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