mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-11-04 05:05:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			564 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			564 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
 | 
						|
 | 
						|
namespace Icinga\Web\View;
 | 
						|
 | 
						|
use Icinga\Util\StringHelper;
 | 
						|
use Icinga\Web\Helper\Markdown;
 | 
						|
 | 
						|
$this->addHelperFunction('ellipsis', function ($string, $maxLength, $ellipsis = '...') {
 | 
						|
    return StringHelper::ellipsis($string, $maxLength, $ellipsis);
 | 
						|
});
 | 
						|
 | 
						|
$this->addHelperFunction('nl2br', function ($string) {
 | 
						|
    return nl2br(str_replace(array('\r\n', '\r', '\n'), '<br>', $string), false);
 | 
						|
});
 | 
						|
 | 
						|
$this->addHelperFunction('markdown', function ($content) {
 | 
						|
    return Markdown::text($content);
 | 
						|
});
 |