4
4
[ ![ Packagist Downloads] ( https://img.shields.io/packagist/dt/co0lc0der/yii2-adminlte3-widgets?color=yellow&style=flat-square )] ( https://packagist.org/packages/co0lc0der/yii2-adminlte3-widgets )
5
5
[ ![ GitHub license] ( https://img.shields.io/github/license/co0lc0der/yii2-adminlte3-widgets?style=flat-square )] ( https://github.com/co0lc0der/yii2-adminlte3-widgets/blob/main/LICENSE.md )
6
6
7
- AdminLTE 3 widgets for Yii2. At present time the extension has CardWidget only. More widgets, helpers and Gii will be added in the future.
7
+ AdminLTE 3 widgets for Yii2. At present time the extension includes
8
+
9
+ * CardWidget
10
+ * TabsCardWidget
11
+ * ProfileCardWidget
12
+
13
+ More widgets, helpers and Gii will be added in the future.
8
14
9
15
## Installation
10
16
@@ -40,7 +46,7 @@ to the require section of your `composer.json` file.
40
46
- ` bool $close = false ` - show / hide close button inside card header
41
47
- ` string $ajaxLoad = '' ` - URL for loading data, if it is not empty it shows a spinner before data loaded
42
48
- ` string $ajaxOverlay = 'overlay' ` - type of loading overlay ('overlay', 'dark')
43
- - ` string $shadow = '' ` - type of loading overlay ('shadow-none', 'shadow-sm', 'shadow', 'shadow-lg')
49
+ - ` string $shadow = '' ` - type of card shadow ('shadow-none', 'shadow-sm', 'shadow', 'shadow-lg')
44
50
- ` array $tools = [] ` - list of header custom tools (labels, buttons, links)
45
51
46
52
## TabsCardWidget
@@ -53,9 +59,21 @@ to the require section of your `composer.json` file.
53
59
- ` bool $background = false ` - makes a colored card, uses $color property (Bootstrap 4 colors)
54
60
- ` bool $gradient = false ` - makes a gradient card, uses $color property (Bootstrap 4 colors)
55
61
- ` string $footer = '' ` - content of card footer
56
- - ` string $shadow = '' ` - type of loading overlay ('shadow-none', 'shadow-sm', 'shadow', 'shadow-lg')
62
+ - ` string $shadow = '' ` - type of card shadow ('shadow-none', 'shadow-sm', 'shadow', 'shadow-lg')
57
63
- ` array $tabs = [] ` - list of tabs (see an example below)
58
64
65
+ ## ProfileCardWidget
66
+
67
+ ### Public properties, its types and default values
68
+
69
+ - ` string $name ` - user name
70
+ - ` string $image = '' ` - user image
71
+ - ` string $position = '' ` - user role or position
72
+ - ` string $color = '' ` - color of a card header (Bootstrap 4 colors. 'success', 'danger' еtс.)
73
+ - ` string $footer = '' ` - content of card footer
74
+ - ` string $shadow = '' ` - type of card shadow ('shadow-none', 'shadow-sm', 'shadow', 'shadow-lg')
75
+ - ` array $rows = [] ` - list of rows (see an example below)
76
+
59
77
## Examples
60
78
61
79
### CardWidget
@@ -67,7 +85,6 @@ to the require section of your `composer.json` file.
67
85
'gradient' => true, // use gradient background
68
86
'expand' => true, // show maximize button in card header
69
87
'footer' => 'some footer', // content of card footer
70
- 'collapse' => true, // show collapse button in card header
71
88
'shadow' => 'shadow-sm', // use small shadow
72
89
'close' => true, // show close button in card header
73
90
'tools' => [ // array with config to add custom labels, buttons or links
@@ -84,9 +101,7 @@ to the require section of your `composer.json` file.
84
101
'link',
85
102
'<i class =" fas fa-pencil-alt" aria-hidden =" true" ></i >',
86
103
['update', 'id' => 1],
87
- [
88
- 'title' => 'Update it',
89
- ],
104
+ ['title' => 'Update it'],
90
105
],
91
106
[
92
107
'button',
@@ -116,21 +131,21 @@ to the require section of your `composer.json` file.
116
131
'title' => 'Tabs example',
117
132
'footer' => 'some footer',
118
133
'tabs' => [
119
- [
120
- 'title' => 'Tab1',
121
- 'id' => 'tab_1',
122
- 'content' => 'A wonderful serenity has taken possession of my entire soul,
123
- like these sweet mornings of spring which I enjoy with my whole heart.',
124
- 'active' => true,
125
- ],
126
- [
127
- 'title' => 'Tab2',
128
- 'id' => 'tab_2',
129
- 'content' => 'The European languages are members of the same family. Their separate existence is a myth.
130
- For science, music, sport, etc, Europe uses the same vocabulary.',
131
- ]
134
+ [
135
+ 'title' => 'Tab1',
136
+ 'id' => 'tab_1',
137
+ 'content' => 'A wonderful serenity has taken possession of my entire soul,
138
+ like these sweet mornings of spring which I enjoy with my whole heart.',
139
+ 'active' => true,
140
+ ],
141
+ [
142
+ 'title' => 'Tab2',
143
+ 'id' => 'tab_2',
144
+ 'content' => 'The European languages are members of the same family. Their separate existence is a myth.
145
+ For science, music, sport, etc, Europe uses the same vocabulary.',
132
146
]
133
- ]);
147
+ ]
148
+ ]);
134
149
?>
135
150
```
136
151
@@ -141,3 +156,35 @@ to the require section of your `composer.json` file.
141
156
### Rendered TabsCard without title
142
157
143
158
![ Rendered TabsCard without title] ( https://code-notes.ru/tabscard_example2.png " Rendered TabsCard without title ")
159
+
160
+ ### ProfileCardWidget
161
+
162
+ ``` php
163
+ <?php ProfileCardWidget::begin([
164
+ 'name' => 'Jonathan Burke Jr.',
165
+ 'position' => 'Software Engineer',
166
+ 'image' => '../avatars/user2-160x160.jpg',
167
+ 'color' => 'info',
168
+ 'rows' => [
169
+ 'Followers' => [
170
+ '1,521',
171
+ '#url'
172
+ ],
173
+ 'Following' => ['373'],
174
+ 'Friends' => ['3,127'],
175
+ 'Projects' => [
176
+ '7',
177
+ 'https://example.com'
178
+ ],
179
+ ],
180
+ ]);
181
+ ?>
182
+
183
+ <a href =" #" class =" btn btn-primary btn-block" ><b >Follow</b ></a >
184
+
185
+ <?php ProfileCardWidget::end();?>
186
+ ```
187
+
188
+ ### Rendered ProfileCard
189
+
190
+ ![ Rendered ProfileCard] ( https://code-notes.ru/profilecard_example.png " Rendered ProfileCard ")
0 commit comments