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

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

Escapes special characters with their escaped counterparts as needed using PHPs htmlentities() function.
См. также: http://www.php.net/manual/function.htmlentities.php
public render ( string $value = null, boolean $keepQuotes = false, string $encoding = 'UTF-8', boolean $doubleEncode = true ) : string
$value string string to format
$keepQuotes boolean if TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
$encoding string
$doubleEncode boolean If FALSE existing html entities won't be encoded, the default is to convert everything.
Результат string the altered string
    public function render($value = null, $keepQuotes = false, $encoding = 'UTF-8', $doubleEncode = true)
    {
        return self::renderStatic(array('value' => $value, 'keepQuotes' => $keepQuotes, 'encoding' => $encoding, 'doubleEncode' => $doubleEncode), $this->buildRenderChildrenClosure(), $this->renderingContext);
    }

Usage Example

 /**
  * @test
  */
 public function renderDoesNotModifySourceIfItIsAnObjectThatCantBeConvertedToAString()
 {
     $user = new UserWithoutToString('Xaver <b>Cross-Site</b>');
     $actualResult = $this->viewHelper->render($user);
     $this->assertSame($user, $actualResult);
 }
HtmlentitiesViewHelper