asNtext() public method

Formats the value as an HTML-encoded plain text with newlines converted into breaks.
public asNtext ( string $value ) : string
$value string the value to be formatted.
return string the formatted result.
コード例 #1
0
ファイル: FormatterTest.php プロジェクト: albertborsos/yii2
 public function testAsNtext()
 {
     $value = '123';
     $this->assertSame($value, $this->formatter->asNtext($value));
     $value = 123;
     $this->assertSame("{$value}", $this->formatter->asNtext($value));
     $value = '<>';
     $this->assertSame('&lt;&gt;', $this->formatter->asNtext($value));
     $value = "123\n456";
     $this->assertSame("123<br />\n456", $this->formatter->asNtext($value));
     // null display
     $this->assertSame($this->formatter->nullDisplay, $this->formatter->asNtext(null));
 }