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


PHP ActionController::initializeActionMethodValidators方法代码示例

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


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

示例1: initializeActionMethodValidators

 /**
  * Adds the needed validators to the Arguments:
  *
  * - Validators checking the data type from the @param annotation
  * - Custom validators specified with validate annotations.
  * - Model-based validators (validate annotations in the model)
  * - Custom model validator classes
  * - Validators from framework configuration
  *
  * @return void
  */
 protected function initializeActionMethodValidators()
 {
     parent::initializeActionMethodValidators();
     $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $actionArgumentValidation = !empty($frameworkConfiguration['mvc']['validation'][$this->request->getControllerName()][$this->request->getControllerActionName()]) ? $frameworkConfiguration['mvc']['validation'][$this->request->getControllerName()][$this->request->getControllerActionName()] : array();
     // Dynamically add argument validators
     foreach ($actionArgumentValidation as $argumentName => $validators) {
         try {
             $argumentValidator = $this->arguments->getArgument($argumentName)->getValidator();
         } catch (NoSuchArgumentException $e) {
             continue;
         }
         $validatorConjunction = $this->validatorResolver->createValidator('TYPO3.CMS.Extbase:Conjunction');
         foreach ($validators as $validatorConfiguration) {
             if (isset($validatorConfiguration['type'])) {
                 $validatorType = $validatorConfiguration['type'];
                 $validatorOptions = isset($validatorConfiguration['options']) ? $validatorConfiguration['options'] : array();
                 $validator = $this->validatorResolver->createValidator($validatorType, $validatorOptions);
                 $validatorConjunction->addValidator($validator);
             }
         }
         if (count($validatorConjunction)) {
             $argumentValidator->addValidator($validatorConjunction);
         }
     }
 }
开发者ID:mjankiewicz,项目名称:hairu,代码行数:37,代码来源:ActionController.php

示例2: initializeActionMethodValidators

 /**
  * Initialize action method validators
  *
  * @return void
  */
 protected function initializeActionMethodValidators()
 {
     if ($this->actionMethodName == 'addAction') {
         parent::initializeActionMethodValidators();
         $blog = $this->arguments['blog'];
         $validator = $blog->getValidator();
         $requestArguments = $this->request->getArguments();
         $agb = $requestArguments['data']['acceptTermsAndConditions'];
         $termsAndConditions = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Lobacher\\Simpleblog\\Validation\\Validator\\TermsAndConditionsValidator', array('value' => $agb));
         $validator->addValidator($termsAndConditions);
     } else {
         parent::initializeActionMethodValidators();
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:19,代码来源:BlogController.php

示例3: initializeActionMethodValidators

 /**
  * This method is overriden to allow proper assignment of parameters to fake actions.
  * 
  * Therefore we change the actionMethodName shortly if the called action is a "fake" action
  *
  * @return void
  * @see initializeArguments()
  */
 protected function initializeActionMethodValidators()
 {
     if (!is_null($this->useActionName)) {
         $temp = $this->actionMethodName;
         $this->actionMethodName = $this->useActionName;
     }
     parent::initializeActionMethodValidators();
     if (!is_null($this->useActionName)) {
         $this->actionMethodName = $temp;
     }
 }
开发者ID:nicodh,项目名称:cz_simple_cal,代码行数:19,代码来源:BaseExtendableController.php


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