TYPO3  7.6
Public Member Functions | Static Public Member Functions | List of all members
PaddingViewHelper Class Reference
Inheritance diagram for PaddingViewHelper:
AbstractViewHelper CompilableInterface

Public Member Functions

 render ($padLength, $padString= ' ', $padType= 'right', $value=null)
 
- Public Member Functions inherited from AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode,\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode,\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 
- Public Member Functions inherited from CompilableInterface
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode,\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode,\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 

Static Public Member Functions

static renderStatic (array $arguments,\Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from AbstractViewHelper
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from CompilableInterface
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractViewHelper
 registerArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 overrideArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 callRenderMethod ()
 
 getLogger ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Protected Attributes inherited from AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = null
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = true
 

Detailed Description

Formats a string using PHPs str_pad function.

See Also
http://www.php.net/manual/en/function.str_pad.php

= Examples =

<f:format.padding padLength="10">TYPO3</f:format.padding> <output> TYPO3 (note the trailing whitespace) <output>

<f:format.padding padLength="10" padString="-=">TYPO3</f:format.padding> <output> TYPO3-=-=- </output>

<f:format.padding padLength="10" padString="-" padType="both">TYPO3</f:format.padding> <output> –TYPO3— </output>

Definition at line 47 of file PaddingViewHelper.php.

Member Function Documentation

render (   $padLength,
  $padString = ' ',
  $padType = 'right',
  $value = null 
)

Pad a string to a certain length with another string

Parameters
int$padLengthLength of the resulting string. If the value of pad_length is negative or less than the length of the input string, no padding takes place.
string$padStringThe padding string
string$padTypeAppend the padding at this site (Possible values: right,left,both. Default: right)
string$valuestring to format
Returns
string The formatted value

Definition at line 59 of file PaddingViewHelper.php.

References AbstractViewHelper\buildRenderChildrenClosure().

static renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

Applies str_pad() on the specified value.

Parameters
array$arguments
\Closure$renderChildrenClosure
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
string

Definition at line 81 of file PaddingViewHelper.php.

References AbstractViewHelper\$renderChildrenClosure.