1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* FontAwesome.php |
4
|
|
|
* @author Revin Roman |
5
|
|
|
* @link https://rmrevin.ru |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace rmrevin\yii\fontawesome; |
9
|
|
|
|
10
|
|
|
use rmrevin\yii\fontawesome\component; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class FA |
14
|
|
|
* @package rmrevin\yii\fontawesome |
15
|
|
|
*/ |
16
|
|
|
class FontAwesome |
17
|
|
|
{ |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* CSS class prefix |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
public static $cssPrefix = 'fa'; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Creates an `Icon` component that can be used to FontAwesome html icon |
27
|
|
|
* |
28
|
|
|
* @param string $name |
29
|
|
|
* @param array $options |
30
|
|
|
* @return component\Icon |
31
|
|
|
*/ |
32
|
9 |
|
public static function icon($name, $options = []) |
33
|
|
|
{ |
34
|
9 |
|
return new component\Icon($name, $options); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Shortcut for `icon()` method |
39
|
|
|
* @see icon() |
40
|
|
|
* |
41
|
|
|
* @param string $name |
42
|
|
|
* @param array $options |
43
|
|
|
* @return component\Icon |
44
|
|
|
*/ |
45
|
1 |
|
public static function i($name, $options = []) |
46
|
|
|
{ |
47
|
1 |
|
return static::icon($name, $options); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Creates an `Stack` component that can be used to FontAwesome html icon |
52
|
|
|
* |
53
|
|
|
* @param array $options |
54
|
|
|
* @return component\Stack |
55
|
|
|
*/ |
56
|
3 |
|
public static function stack($options = []) |
57
|
|
|
{ |
58
|
3 |
|
return new component\Stack($options); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Shortcut for `stack()` method |
63
|
|
|
* @see stack() |
64
|
|
|
* |
65
|
|
|
* @param array $options |
66
|
|
|
* @return component\Stack |
67
|
|
|
*/ |
68
|
1 |
|
public static function s($options = []) |
69
|
|
|
{ |
70
|
1 |
|
return static::stack($options); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param array $options |
75
|
|
|
* @return component\UnorderedList |
76
|
|
|
*/ |
77
|
2 |
|
public static function ul($options = []) |
78
|
|
|
{ |
79
|
2 |
|
return new component\UnorderedList($options); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Size values |
84
|
|
|
* @see component\Icon::size |
85
|
|
|
*/ |
86
|
|
|
const SIZE_LARGE = 'lg'; |
87
|
|
|
const SIZE_2X = '2x'; |
88
|
|
|
const SIZE_3X = '3x'; |
89
|
|
|
const SIZE_4X = '4x'; |
90
|
|
|
const SIZE_5X = '5x'; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Rotate values |
94
|
|
|
* @see component\Icon::rotate |
95
|
|
|
*/ |
96
|
|
|
const ROTATE_90 = '90'; |
97
|
|
|
const ROTATE_180 = '180'; |
98
|
|
|
const ROTATE_270 = '270'; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Flip values |
102
|
|
|
* @see component\Icon::flip |
103
|
|
|
*/ |
104
|
|
|
const FLIP_HORIZONTAL = 'horizontal'; |
105
|
|
|
const FLIP_VERTICAL = 'vertical'; |
106
|
|
|
} |
107
|
|
|
|