ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 

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.

References $url, and getURL().

39  : string
40  {
41  $url = $this->getURL($command, $param);
42  return $url->baseURI() . '?' . $url->query();
43  }
$url
getURL(string $command, int $param=null)
Get an URL for the provided command and params.
+ 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.

References PHPMailer\PHPMailer\$params, $query, and $url.

Referenced by getHref().

21  {
22  $query = $this->base_url->query();
23  if (!$query) {
24  $params = [];
25  } else {
26  parse_str($this->base_url->query(), $params);
27  }
28 
29  $params[self::PARAM_LSO_COMMAND] = $command;
30  if (is_null($param)) {
31  unset($params[self::PARAM_LSO_PARAMETER]);
32  } else {
33  $params[self::PARAM_LSO_PARAMETER] = $param;
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:17
$query
$url
+ 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 LSUrlBuilderTest\testUrlConcatenation().

◆ PARAM_LSO_PARAMETER

const LSUrlBuilder::PARAM_LSO_PARAMETER = 'lsov'

Definition at line 13 of file LSUrlBuilder.php.

Referenced by LSUrlBuilderTest\testUrlConcatenation().


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