PHP Трейт FluidTYPO3\Vhs\Traits\ConditionViewHelperTrait

Показать файл Открыть проект

Открытые методы

Метод Описание
render ( ) : string renders child if $condition is true, otherwise renders child.
renderStatic ( array $arguments, Closure $renderChildrenClosure, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : mixed Default implementation for use in compiled templates

Защищенные методы

Метод Описание
evaluateCondition ( array $arguments = null ) : boolean This method decides if the condition is TRUE or FALSE.
renderStaticElseChild ( array $arguments, boolean &$hasEvaluated ) : string Statically evalute "else" children.
renderStaticThenChild ( array $arguments, boolean &$hasEvaluated ) : string Statically evalute "then" children.

Описание методов

evaluateCondition() защищенный статический Метод

TODO: remove at some point, because this is only here for legacy reasons. the AbstractConditionViewHelper in 6.2.* doesn't have a default render method. 7.2+ on the other hand provides basically exactly this method here luckily it's backwards compatible out of the box. tl;dr -> remove after expiration of support for anything below 7.2
protected static evaluateCondition ( array $arguments = null ) : boolean
$arguments array
Результат boolean

render() публичный Метод

renders child if $condition is true, otherwise renders child.
public render ( ) : string
Результат string the rendered string

renderStatic() публичный статический Метод

TODO: remove at some point, because this is only here for legacy reasons. the AbstractConditionViewHelper in 6.2.* doesn't have a default render method. 7.2+ on the other hand provides basically exactly this method here luckily it's backwards compatible out of the box. tl;dr -> remove after expiration of support for anything below 7.2
public static renderStatic ( array $arguments, Closure $renderChildrenClosure, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : mixed
$arguments array
$renderChildrenClosure Closure
$renderingContext TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
Результат mixed

renderStaticElseChild() защищенный статический Метод

The "$hasEvaluated" argument is there to distinguish the case that "else" returned NULL or was not evaluated. TODO: remove at some point, because this is only here for legacy reasons. the AbstractConditionViewHelper in 6.2.* doesn't have a default render method. 7.2+ on the other hand provides basically exactly this method here luckily it's backwards compatible out of the box. tl;dr -> remove after expiration of support for anything below 7.2
protected static renderStaticElseChild ( array $arguments, boolean &$hasEvaluated ) : string
$arguments array ViewHelper arguments
$hasEvaluated boolean Can be used to check if the "else" child was actually evaluated by this method.
Результат string

renderStaticThenChild() защищенный статический Метод

The "$hasEvaluated" argument is there to distinguish the case that "then" returned NULL or was not evaluated. TODO: remove at some point, because this is only here for legacy reasons. the AbstractConditionViewHelper in 6.2.* doesn't have a default render method. 7.2+ on the other hand provides basically exactly this method here luckily it's backwards compatible out of the box. tl;dr -> remove after expiration of support for anything below 7.2
protected static renderStaticThenChild ( array $arguments, boolean &$hasEvaluated ) : string
$arguments array ViewHelper arguments
$hasEvaluated boolean Can be used to check if the "then" child was actually evaluated by this method.
Результат string