ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
LSUrlBuilder Class Reference

Class LSUrlBuilder. More...

+ Inheritance diagram for LSUrlBuilder:
+ Collaboration diagram for LSUrlBuilder:

Public Member Functions

 __construct (ILIAS\Data\URI $base_url)
 
 getURL (string $command, int $param=null)
 Get an URL for the provided command and params. More...
 
 getHref (string $command, int $param=null)
 
 getURL (string $command, int $param=null)
 Get an URL for the provided command and params. More...
 

Data Fields

const PARAM_LSO_COMMAND = 'lsocmd'
 
const PARAM_LSO_PARAMETER = 'lsov'
 

Detailed Description

Class LSUrlBuilder.

Definition at line 10 of file LSUrlBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

LSUrlBuilder::__construct ( ILIAS\Data\URI  $base_url)

Definition at line 15 of file LSUrlBuilder.php.

16 {
17 $this->base_url = $base_url;
18 }

Member Function Documentation

◆ getHref()

LSUrlBuilder::getHref ( string  $command,
int  $param = null 
)

Definition at line 39 of file LSUrlBuilder.php.

39 : string
40 {
41 $url = $this->getURL($command, $param);
42 return $url->getBaseURI() . '?' . $url->getQuery();
43 }
getURL(string $command, int $param=null)
Get an URL for the provided command and params.
$url
$param
Definition: xapitoken.php:31

References $param, $url, and getURL().

+ Here is the call graph for this function:

◆ getURL()

LSUrlBuilder::getURL ( string  $command,
int  $param = null 
)

Get an URL for the provided command and params.

Implements ILIAS\KioskMode\URLBuilder.

Definition at line 20 of file LSUrlBuilder.php.

21 {
22 $query = $this->base_url->getQuery();
23 if (!$query) {
24 $params = [];
25 } else {
26 parse_str($this->base_url->getQuery(), $params);
27 }
28
29 $params[self::PARAM_LSO_COMMAND] = $command;
30 if (is_null($param)) {
31 unset($params[self::PARAM_LSO_PARAMETER]);
32 } else {
34 }
35 $url = $this->base_url->withQuery(http_build_query($params));
36 return $url;
37 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
const PARAM_LSO_COMMAND
const PARAM_LSO_PARAMETER
$query

References $param, $query, $url, PARAM_LSO_COMMAND, and PARAM_LSO_PARAMETER.

Referenced by getHref().

+ Here is the caller graph for this function:

Field Documentation

◆ PARAM_LSO_COMMAND

const LSUrlBuilder::PARAM_LSO_COMMAND = 'lsocmd'

Definition at line 12 of file LSUrlBuilder.php.

Referenced by getURL(), and LSUrlBuilderTest\testUrlConcatenation().

◆ PARAM_LSO_PARAMETER

const LSUrlBuilder::PARAM_LSO_PARAMETER = 'lsov'

Definition at line 13 of file LSUrlBuilder.php.

Referenced by getURL(), and LSUrlBuilderTest\testUrlConcatenation().


The documentation for this class was generated from the following file: