ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
LSUrlBuilder Class Reference
+ 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'
 

Protected Attributes

ILIAS Data URI $base_url
 

Detailed Description

Definition at line 23 of file LSUrlBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 30 of file LSUrlBuilder.php.

References $base_url.

31  {
32  $this->base_url = $base_url;
33  }
ILIAS Data URI $base_url

Member Function Documentation

◆ getHref()

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

Definition at line 53 of file LSUrlBuilder.php.

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

53  : string
54  {
55  $url = $this->getURL($command, $param);
56  return $url->getBaseURI() . '?' . $url->getQuery();
57  }
$param
Definition: xapitoken.php:46
$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 35 of file LSUrlBuilder.php.

References $param, $params, and $query.

Referenced by getHref().

36  {
37  $query = $this->base_url->getQuery();
38  if (!$query) {
39  $params = [];
40  } else {
41  parse_str($this->base_url->getQuery(), $params);
42  }
43 
44  $params[self::PARAM_LSO_COMMAND] = $command;
45  if (is_null($param)) {
46  unset($params[self::PARAM_LSO_PARAMETER]);
47  } else {
48  $params[self::PARAM_LSO_PARAMETER] = $param;
49  }
50  return $this->base_url->withQuery(http_build_query($params));
51  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$param
Definition: xapitoken.php:46
$query
+ Here is the caller graph for this function:

Field Documentation

◆ $base_url

ILIAS Data URI LSUrlBuilder::$base_url
protected

Definition at line 28 of file LSUrlBuilder.php.

Referenced by __construct().

◆ PARAM_LSO_COMMAND

const LSUrlBuilder::PARAM_LSO_COMMAND = 'lsocmd'

Definition at line 25 of file LSUrlBuilder.php.

Referenced by LSUrlBuilderTest\testUrlConcatenation().

◆ PARAM_LSO_PARAMETER

const LSUrlBuilder::PARAM_LSO_PARAMETER = 'lsov'

Definition at line 26 of file LSUrlBuilder.php.

Referenced by LSUrlBuilderTest\testUrlConcatenation().


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