lib: Add nl2br view helper

refs #10603
This commit is contained in:
Eric Lippmann 2015-11-20 15:17:38 +01:00
parent b3587b7439
commit 91e576d530
1 changed files with 4 additions and 0 deletions

View File

@ -6,3 +6,7 @@ use Icinga\Util\String;
$this->addHelperFunction('ellipsis', function ($string, $maxLength, $ellipsis = '...') {
return String::ellipsis($string, $maxLength, $ellipsis);
});
$this->addHelperFunction('nl2br', function ($string) {
return str_replace(array('\r\n', '\r', '\n'), '<br>', $string);
});