Neos\FluidAdaptor\ViewHelpers\Format\PaddingViewHelper::render PHP Метод

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

Pad a string to a certain length with another string
public render ( integer $padLength, string $padString = ' ', string $padType = 'right', string $value = null ) : string
$padLength integer Length 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.
$padString string The padding string
$padType string Append the padding at this site (Possible values: right,left,both. Default: right)
$value string string to format
Результат string The formatted value
    public function render($padLength, $padString = ' ', $padType = 'right', $value = null)
    {
        return self::renderStatic(array('padLength' => $padLength, 'padString' => $padString, 'padType' => $padType, 'value' => $value), $this->buildRenderChildrenClosure(), $this->renderingContext);
    }

Usage Example

 /**
  * @test
  */
 public function integersArePaddedCorrectly()
 {
     $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue(123));
     $actualResult = $this->viewHelper->render(5, '0');
     $this->assertEquals('12300', $actualResult);
 }
PaddingViewHelper