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


PHP ReflectionService::getPropertyTagValues方法代码示例

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


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

示例1: renderStatic

 /**
  * Default implementation for use in compiled templates
  *
  * @param array $arguments
  * @param \Closure $renderChildrenClosure
  * @param RenderingContextInterface $renderingContext
  * @return mixed
  */
 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 {
     if (self::$staticReflectionService === NULL) {
         $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         self::$staticReflectionService = $objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     }
     $property = $arguments['property'];
     $validatorName = isset($arguments['validatorName']) ? $arguments['validatorName'] : NULL;
     $object = isset($arguments['object']) ? $arguments['object'] : NULL;
     if (NULL === $object) {
         $object = self::getFormObject($renderingContext->getViewHelperVariableContainer());
     }
     $className = get_class($object);
     if (FALSE !== strpos($property, '.')) {
         $pathSegments = explode('.', $property);
         foreach ($pathSegments as $property) {
             if (TRUE === ctype_digit($property)) {
                 continue;
             }
             $annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'var');
             $possibleClassName = array_pop($annotations);
             if (FALSE !== strpos($possibleClassName, '<')) {
                 $className = array_pop(explode('<', trim($possibleClassName, '>')));
             } elseif (TRUE === class_exists($possibleClassName)) {
                 $className = $possibleClassName;
             }
         }
     }
     $annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'validate');
     $hasEvaluated = TRUE;
     if (0 < count($annotations) && (NULL === $validatorName || TRUE === in_array($validatorName, $annotations))) {
         return static::renderStaticThenChild($arguments, $hasEvaluated);
     }
     return static::renderStaticElseChild($arguments, $hasEvaluated);
 }
开发者ID:smichaelsen,项目名称:vhs,代码行数:43,代码来源:HasValidatorViewHelper.php

示例2: render

 /**
  * Render
  *
  * Renders the then-child if the property at $property of the
  * object at $object (or the associated form object if $object
  * is not specified) uses a certain @validate validator.
  *
  * @param string $property The property name, dotted path supported, to determine required
  * @param string $validatorName The class name of the Validator that indicates the property is required
  * @param DomainObjectInterface $object Optional object - if not specified, grabs the associated form object
  * @return string
  */
 public function render($property, $validatorName = NULL, DomainObjectInterface $object = NULL)
 {
     if (NULL === $object) {
         $object = $this->getFormObject();
     }
     $className = get_class($object);
     if (FALSE !== strpos($property, '.')) {
         $pathSegments = explode('.', $property);
         foreach ($pathSegments as $property) {
             if (TRUE === ctype_digit($property)) {
                 continue;
             }
             $annotations = $this->ownReflectionService->getPropertyTagValues($className, $property, 'var');
             $possibleClassName = array_pop($annotations);
             if (FALSE !== strpos($possibleClassName, '<')) {
                 $className = array_pop(explode('<', trim($possibleClassName, '>')));
             } elseif (TRUE === class_exists($possibleClassName)) {
                 $className = $possibleClassName;
             }
         }
     }
     $annotations = $this->ownReflectionService->getPropertyTagValues($className, $property, 'validate');
     if (0 < count($annotations) && (NULL === $validatorName || TRUE === in_array($validatorName, $annotations))) {
         return $this->renderThenChild();
     }
     return $this->renderElseChild();
 }
开发者ID:JostBaron,项目名称:vhs,代码行数:39,代码来源:HasValidatorViewHelper.php

示例3: evaluateCondition

 /**
  * @param array $arguments
  * @return boolean
  */
 protected static function evaluateCondition($arguments = null)
 {
     if (self::$staticReflectionService === null) {
         $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         self::$staticReflectionService = $objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     }
     $property = $arguments['property'];
     $validatorName = isset($arguments['validatorName']) ? $arguments['validatorName'] : null;
     $object = isset($arguments['object']) ? $arguments['object'] : null;
     if (null === $object) {
         $object = static::getFormObject($renderingContext->getViewHelperVariableContainer());
     }
     $className = get_class($object);
     if (false !== strpos($property, '.')) {
         $pathSegments = explode('.', $property);
         foreach ($pathSegments as $property) {
             if (true === ctype_digit($property)) {
                 continue;
             }
             $annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'var');
             $possibleClassName = array_pop($annotations);
             if (false !== strpos($possibleClassName, '<')) {
                 $className = array_pop(explode('<', trim($possibleClassName, '>')));
             } elseif (true === class_exists($possibleClassName)) {
                 $className = $possibleClassName;
             }
         }
     }
     $annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'validate');
     return count($annotations) && (!$validatorName || in_array($validatorName, $annotations));
 }
开发者ID:fluidtypo3,项目名称:vhs,代码行数:35,代码来源:HasValidatorViewHelper.php


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