ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Custom.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
6 use ILIAS\UI\Component as C;
8 
9 class Custom extends Icon implements C\Icon\Custom
10 {
11 
15  private $icon_path;
16 
17 
19  {
20  $this->checkStringArg("string", $icon_path);
21  $this->checkStringArg("string", $aria_label);
22  $this->checkArgIsElement(
23  "size",
24  $size,
25  self::$possible_sizes,
26  implode(self::$possible_sizes, '/')
27  );
28  $this->name = 'custom';
29  $this->icon_path = $icon_path;
30  $this->aria_label = $aria_label;
31  $this->size = $size;
32  }
33 
37  public function getIconPath()
38  {
39  return $this->icon_path;
40  }
41 }
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
__construct($icon_path, $aria_label, $size)
Definition: Custom.php:18
Set page orientation and size
Definition: 04printing.php:77