ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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->checkBoolArg("is_disabled", $is_disabled);
29  $this->name = 'custom';
30  $this->icon_path = $icon_path;
31  $this->aria_label = $aria_label;
32  $this->size = $size;
33  $this->is_disabled = $is_disabled;
34  }
35 
39  public function getIconPath()
40  {
41  return $this->icon_path;
42  }
43 }
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.
checkBoolArg($which, $value)
Throw an InvalidArgumentException if $value is not a bool.
__construct($icon_path, $aria_label, $size, $is_disabled)
Definition: Custom.php:18
font size
Definition: langcheck.php:162