3 declare(strict_types=1);
17 $this->base_url = $base_url;
20 public function getURL(
string $command,
int $param = null) :
ILIAS\Data\URI
22 $query = $this->base_url->query();
26 parse_str($this->base_url->query(),
$params);
29 $params[self::PARAM_LSO_COMMAND] = $command;
30 if (is_null($param)) {
31 unset($params[self::PARAM_LSO_PARAMETER]);
33 $params[self::PARAM_LSO_PARAMETER] = $param;
35 $url = $this->base_url->withQuery(http_build_query($params));
39 public function getHref(
string $command,
int $param = null) : string
42 return $url->baseURI() .
'?' .
$url->query();
__construct(ILIAS\Data\URI $base_url)
const PARAM_LSO_PARAMETER
getHref(string $command, int $param=null)
The URLBuilder allows views to get links that are used somewhere inline in the content.
getURL(string $command, int $param=null)
Get an URL for the provided command and params.