ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLink.php
Go to the documentation of this file.
1<?php
2
21
22class ilLink
23{
27 public static function _getLink(
28 ?int $a_ref_id,
29 string $a_type = '',
30 array $a_params = [],
31 string $append = ""
32 ): string {
33 global $DIC;
35 $static_url = $DIC["static_url"];
36
37 $ilObjDataCache = $DIC["ilObjDataCache"];
38
39 if ($a_type === '' && $a_ref_id) {
40 $a_type = $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_ref_id));
41 }
42
43 $target = urlencode(CLIENT_ID) . '_' . $a_type . '_' . $a_ref_id . urlencode($append);
44
45 $a_params = array_merge($a_params, [$append]);
46 $a_params = array_filter($a_params, static function ($value): bool {
47 return $value !== "";
48 });
49
50 if (!empty($a_type)) {
51 return (string) $static_url->builder()->build(
52 $a_type,
53 $a_ref_id !== null ? new ReferenceId($a_ref_id) : null,
54 $a_params
55 );
56 }
57
58 return '';
59 }
60
64 public static function _getStaticLink(
65 ?int $a_ref_id,
66 string $a_type = '',
67 bool $a_fallback_goto = true,
68 string $append = ""
69 ): string {
70 return self::_getLink($a_ref_id, $a_type, [], $append);
71 }
72}
Class Services.
Definition: Services.php:38
const CLIENT_ID
Definition: constants.php:41
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$static_url
Definition: goto.php:29
global $DIC
Definition: shib_login.php:26