icingaweb2/library/Icinga/Web/View/helpers/string.php

13 lines
352 B
PHP
Raw Normal View History

2015-01-19 14:20:57 +01:00
<?php
namespace Icinga\Web\View;
use Icinga\Util\StringHelper;
2015-01-19 14:20:57 +01:00
$this->addHelperFunction('ellipsis', function ($string, $maxLength, $ellipsis = '...') {
return StringHelper::ellipsis($string, $maxLength, $ellipsis);
2015-01-19 14:20:57 +01:00
});
2015-11-20 15:17:38 +01:00
$this->addHelperFunction('nl2br', function ($string) {
return str_replace(array('\r\n', '\r', '\n'), '<br>', $string);
});