PHP Trait 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.
Afficher le fichier Open project: fluidtypo3/vhs

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
backupVariables ( array $variables, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer ) : array
restoreVariables ( array $variables, array $backups, TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer ) : void

Method Details

initializeArguments() public méthode

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
Résultat void

registerAsArgument() protected méthode

Registers the "as" argument for use with the implementing ViewHelper.
protected registerAsArgument ( ) : void
Résultat void

renderChildrenWithVariableOrReturnInput() protected méthode

protected renderChildrenWithVariableOrReturnInput ( string $variable = null ) : mixed
$variable string
Résultat mixed

renderChildrenWithVariableOrReturnInputStatic() protected static méthode

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
Résultat mixed

renderChildrenWithVariables() protected méthode

Returns the output of the renderChildren() method on $viewHelper.
protected renderChildrenWithVariables ( array $variables ) : mixed
$variables array
Résultat mixed

renderChildrenWithVariablesStatic() protected static méthode

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
Résultat mixed