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

Trait implementable by ViewHelpers which operate with template variables in one way or another. Contains the following main responsibilities: - A generic "as" argument solution - A method to render child content with automatically backed up variables specified in an array.
Показать файл Открыть проект

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

Метод Описание
initializeArguments ( ) : void Default initialisation of arguments - will be used if the implementing ViewHelper does not itself define this method. The default behavior is to only register the "as" argument.

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

Метод Описание
registerAsArgument ( ) : void Registers the "as" argument for use with the implementing ViewHelper.
renderChildrenWithVariableOrReturnInput ( string $variable = null ) : mixed
renderChildrenWithVariableOrReturnInputStatic ( mixed $variable, string $as, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext, Closure $renderChildrenClosure ) : mixed
renderChildrenWithVariables ( array $variables ) : mixed Renders tag content of ViewHelper and inserts variables in $variables into $variableContainer while keeping backups of each existing variable, restoring it after rendering.
renderChildrenWithVariablesStatic ( array $variables, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer, Closure $renderChildrenClosure ) : mixed Renders tag content of ViewHelper and inserts variables in $variables into $variableContainer while keeping backups of each existing variable, restoring it after rendering.

Приватные методы

Метод Описание
backupVariables ( array $variables, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer ) : array
restoreVariables ( array $variables, array $backups, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer ) : void

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

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

Default initialisation of arguments - will be used if the implementing ViewHelper does not itself define this method. The default behavior is to only register the "as" argument.
public initializeArguments ( ) : void
Результат void

registerAsArgument() защищенный Метод

Registers the "as" argument for use with the implementing ViewHelper.
protected registerAsArgument ( ) : void
Результат void

renderChildrenWithVariableOrReturnInput() защищенный Метод

protected renderChildrenWithVariableOrReturnInput ( string $variable = null ) : mixed
$variable string
Результат mixed

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

protected static renderChildrenWithVariableOrReturnInputStatic ( mixed $variable, string $as, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext, Closure $renderChildrenClosure ) : mixed
$variable mixed
$as string
$renderingContext TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
$renderChildrenClosure Closure
Результат mixed

renderChildrenWithVariables() защищенный Метод

Returns the output of the renderChildren() method on $viewHelper.
protected renderChildrenWithVariables ( array $variables ) : mixed
$variables array
Результат mixed

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

Returns the output of the renderChildren() method on $viewHelper.
protected static renderChildrenWithVariablesStatic ( array $variables, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer, Closure $renderChildrenClosure ) : mixed
$variables array
$templateVariableContainer TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
$renderChildrenClosure Closure
Результат mixed