public render ( integer $maxCharacters, string $append = '...', string $value = null ) : string | ||
$maxCharacters | integer | Place where to truncate the string |
$append | string | What to append, if truncation happened |
$value | string | The input value which should be cropped. If not set, the evaluated contents of the child nodes will be used |
return | string | cropped text |
public function render($maxCharacters, $append = '...', $value = null)
{
return self::renderStatic(array('maxCharacters' => $maxCharacters, 'append' => $append, 'value' => $value), $this->buildRenderChildrenClosure(), $this->renderingContext);
}
/** * @test */ public function viewHelperHandlesMultiByteValuesCorrectly() { $this->viewHelper->expects($this->never())->method('renderChildren'); $actualResult = $this->viewHelper->render(3, '...', 'Äßütest'); $this->assertEquals('Äßü...', $actualResult); }