mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Add view helper url
This commit is contained in:
parent
ca09dc084d
commit
297b621bf6
19
library/Icinga/Web/View/helpers/url.php
Normal file
19
library/Icinga/Web/View/helpers/url.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Web\View;
|
||||
|
||||
use Icinga\Web\Url;
|
||||
|
||||
function url($path = null, $params = null)
|
||||
{
|
||||
if ($path === null) {
|
||||
$url = Url::current();
|
||||
if ($params !== null) {
|
||||
$url->setParams($params);
|
||||
}
|
||||
} else {
|
||||
$url = Url::create($path, $params);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user