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


PHP ConfigurationManagerInterface::isFeatureEnabled方法代码示例

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


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

示例1: setValue

 /**
  * Sets the value of this argument.
  *
  * @param mixed $rawValue The value of this argument
  * @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException if the argument is not a valid object of type $dataType
  */
 public function setValue($rawValue)
 {
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         if ($rawValue === NULL) {
             $this->value = NULL;
             return $this;
         }
         if (is_object($rawValue) && $rawValue instanceof $this->dataType) {
             $this->value = $rawValue;
             return $this;
         }
         $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->propertyMappingConfiguration);
         $this->validationResults = $this->propertyMapper->getMessages();
         if ($this->validator !== NULL) {
             // TODO: Validation API has also changed!!!
             $validationMessages = $this->validator->validate($this->value);
             $this->validationResults->merge($validationMessages);
         }
         return $this;
     } else {
         if ($rawValue === NULL || is_object($rawValue) && $rawValue instanceof $this->dataType) {
             $this->value = $rawValue;
         } else {
             $this->value = $this->transformValue($rawValue);
         }
         return $this;
     }
 }
开发者ID:KarlDennisMatthaei1923,项目名称:PierraaDesign,代码行数:35,代码来源:Argument.php

示例2: setErrorClassAttribute

 /**
  * Add an CSS class if this view helper has errors
  *
  * @return void
  */
 protected function setErrorClassAttribute()
 {
     if ($this->hasArgument('class')) {
         $cssClass = $this->arguments['class'] . ' ';
     } else {
         $cssClass = '';
     }
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         $mappingResultsForProperty = $this->getMappingResultsForProperty();
         if ($mappingResultsForProperty->hasErrors()) {
             if ($this->hasArgument('errorClass')) {
                 $cssClass .= $this->arguments['errorClass'];
             } else {
                 $cssClass .= 'error';
             }
             $this->tag->addAttribute('class', $cssClass);
         }
     } else {
         // @deprecated since Fluid 1.4.0, will will be removed two versions after Fluid 6.1.
         $errors = $this->getErrorsForProperty();
         if (count($errors) > 0) {
             if ($this->hasArgument('errorClass')) {
                 $cssClass .= $this->arguments['errorClass'];
             } else {
                 $cssClass .= 'error';
             }
             $this->tag->addAttribute('class', $cssClass);
         }
     }
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:35,代码来源:AbstractFormFieldViewHelper.php

示例3: setValue

 /**
  * Sets the value of this argument.
  *
  * @param mixed $rawValue The value of this argument
  * @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument
  * @throws \TYPO3\CMS\Extbase\Property\Exception
  */
 public function setValue($rawValue)
 {
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         if ($rawValue === NULL) {
             $this->value = NULL;
             return $this;
         }
         if (is_object($rawValue) && $rawValue instanceof $this->dataType) {
             $this->value = $rawValue;
             return $this;
         }
         try {
             $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->propertyMappingConfiguration);
         } catch (TargetNotFoundException $e) {
             // for optional arguments no exeption is thrown.
             if ($this->isRequired()) {
                 throw $e;
             }
         }
         $this->validationResults = $this->propertyMapper->getMessages();
         if ($this->validator !== NULL) {
             // TODO: Validation API has also changed!!!
             $validationMessages = $this->validator->validate($this->value);
             $this->validationResults->merge($validationMessages);
         }
         return $this;
     } else {
         if ($rawValue === NULL || is_object($rawValue) && $rawValue instanceof $this->dataType) {
             $this->value = $rawValue;
         } else {
             $this->value = $this->transformValue($rawValue);
         }
         return $this;
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:42,代码来源:Argument.php

示例4: uriFor

 /**
  * Creates an URI used for linking to an Extbase action.
  * Works in Frontend and Backend mode of TYPO3.
  *
  * @param string $actionName Name of the action to be called
  * @param array $controllerArguments Additional query parameters. Will be "namespaced" and merged with $this->arguments.
  * @param string $controllerName Name of the target controller. If not set, current ControllerName is used.
  * @param string $extensionName Name of the target extension, without underscores. If not set, current ExtensionName is used.
  * @param string $pluginName Name of the target plugin. If not set, current PluginName is used.
  * @return string the rendered URI
  * @api
  * @see build()
  */
 public function uriFor($actionName = NULL, $controllerArguments = array(), $controllerName = NULL, $extensionName = NULL, $pluginName = NULL)
 {
     if ($actionName !== NULL) {
         $controllerArguments['action'] = $actionName;
     }
     if ($controllerName !== NULL) {
         $controllerArguments['controller'] = $controllerName;
     } else {
         $controllerArguments['controller'] = $this->request->getControllerName();
     }
     if ($extensionName === NULL) {
         $extensionName = $this->request->getControllerExtensionName();
     }
     if ($pluginName === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
         $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controllerArguments['controller'], $controllerArguments['action']);
     }
     if ($pluginName === NULL) {
         $pluginName = $this->request->getPluginName();
     }
     $this->disableCacheHashForNonCacheableAction($controllerArguments);
     if ($this->environmentService->isEnvironmentInFrontendMode() && $this->configurationManager->isFeatureEnabled('skipDefaultArguments')) {
         $controllerArguments = $this->removeDefaultControllerAndAction($controllerArguments, $extensionName, $pluginName);
     }
     if ($this->targetPageUid === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
         $this->targetPageUid = $this->extensionService->getTargetPidByPlugin($extensionName, $pluginName);
     }
     if ($this->format !== '') {
         $controllerArguments['format'] = $this->format;
     }
     if ($this->argumentPrefix !== NULL) {
         $prefixedControllerArguments = array($this->argumentPrefix => $controllerArguments);
     } else {
         $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
         $prefixedControllerArguments = array($pluginNamespace => $controllerArguments);
     }
     ArrayUtility::mergeRecursiveWithOverrule($this->arguments, $prefixedControllerArguments);
     return $this->build();
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:51,代码来源:UriBuilder.php

示例5: mapRequestArgumentsToControllerArguments

 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @throws Exception\RequiredArgumentMissingException
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         foreach ($this->arguments as $argument) {
             $argumentName = $argument->getName();
             if ($this->request->hasArgument($argumentName)) {
                 $argument->setValue($this->request->getArgument($argumentName));
             } elseif ($argument->isRequired()) {
                 throw new \TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set for ' . $this->request->getControllerObjectName() . '->' . $this->request->getControllerActionName() . '.', 1298012500);
             }
         }
     } else {
         // @deprecated since Extbase 1.4, will be removed two versions after Extbase 6.1
         $optionalPropertyNames = array();
         $allPropertyNames = $this->arguments->getArgumentNames();
         foreach ($allPropertyNames as $propertyName) {
             if ($this->arguments[$propertyName]->isRequired() === FALSE) {
                 $optionalPropertyNames[] = $propertyName;
             }
         }
         /** @var $validator ArgumentsValidator */
         $validator = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentsValidator');
         $this->deprecatedPropertyMapper->mapAndValidate($allPropertyNames, $this->request->getArguments(), $this->arguments, $optionalPropertyNames, $validator);
         $this->argumentsMappingResults = $this->deprecatedPropertyMapper->getMappingResults();
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:32,代码来源:AbstractController.php

示例6: renderHiddenReferrerFields

 /**
  * Renders hidden form fields for referrer information about
  * the current controller and action.
  *
  * @return string Hidden fields with referrer information
  * @todo filter out referrer information that is equal to the target (e.g. same packageKey)
  */
 protected function renderHiddenReferrerFields()
 {
     $request = $this->controllerContext->getRequest();
     $extensionName = $request->getControllerExtensionName();
     $vendorName = $request->getControllerVendorName();
     $controllerName = $request->getControllerName();
     $actionName = $request->getControllerActionName();
     $result = chr(10);
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@extension]') . '" value="' . $extensionName . '" />' . chr(10);
         if ($vendorName !== NULL) {
             $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@vendor]') . '" value="' . $vendorName . '" />' . chr(10);
         }
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@controller]') . '" value="' . $controllerName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@action]') . '" value="' . $actionName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[arguments]') . '" value="' . htmlspecialchars($this->hashService->appendHmac(base64_encode(serialize($request->getArguments())))) . '" />' . chr(10);
     } else {
         // @deprecated since Fluid 1.4.0, will be removed two versions after Fluid 6.1.
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[extensionName]') . '" value="' . $extensionName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[controllerName]') . '" value="' . $controllerName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[actionName]') . '" value="' . $actionName . '" />' . chr(10);
     }
     return $result;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:31,代码来源:FormViewHelper.php


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