| 1 |
<?php |
| 2 |
|
| 3 |
namespace ipl\Web\Widget; |
| 4 |
|
| 5 |
use ipl\Html\Attributes; |
| 6 |
|
| 7 |
class IcingaIcon extends Icon |
| 8 |
{ |
| 9 |
protected $style = ''; |
| 10 |
|
| 11 |
/** |
| 12 |
* Create an icon element |
| 13 |
* |
| 14 |
* Creates an icon element from the given name and HTML attributes. The icon element's tag will be <i>. The given |
| 15 |
* name will be used as automatically added CSS class for the icon element in the format 'iicon-$name'. In addition, |
| 16 |
* the CSS class 'icon' will be automatically added too. |
| 17 |
* |
| 18 |
* @param string $name The name of the icon |
| 19 |
* @param Attributes|array $attributes The HTML attributes for the element |
| 20 |
*/ |
| 21 |
public function __construct(string $name, $attributes = null) |
| 22 |
{ |
| 23 |
$this |
| 24 |
->getAttributes() |
| 25 |
->add('class', ['icon', "iicon-$name"]) |
| 26 |
->add($attributes); |
| 27 |
} |
| 28 |
} |