2017-06-22 02:03:54 +02:00
|
|
|
<?php
|
|
|
|
|
2017-10-09 15:23:27 +02:00
|
|
|
namespace dipl\Html;
|
2017-06-22 02:03:54 +02:00
|
|
|
|
2018-05-05 01:11:55 +02:00
|
|
|
class Icon extends BaseHtmlElement
|
2017-06-22 02:03:54 +02:00
|
|
|
{
|
|
|
|
protected $tag = 'i';
|
|
|
|
|
|
|
|
public function __construct($name, $attributes = null)
|
|
|
|
{
|
|
|
|
$this->setAttributes($attributes);
|
2018-05-05 00:18:45 +02:00
|
|
|
$this->getAttributes()->add('class', array('icon', 'icon-' . $name));
|
2017-06-22 02:03:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $name
|
|
|
|
* @param array $attributes
|
|
|
|
*
|
|
|
|
* @return static
|
|
|
|
*/
|
|
|
|
public static function create($name, array $attributes = null)
|
|
|
|
{
|
|
|
|
return new static($name, $attributes);
|
|
|
|
}
|
|
|
|
}
|