Add view helper url

This commit is contained in:
Eric Lippmann 2013-07-12 14:45:25 +02:00
parent ca09dc084d
commit 297b621bf6
1 changed files with 19 additions and 0 deletions

View 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;
}