Since v0.6
Pay attention! You should use echo
and widget()
method when you work with the widget. It uses ShadowSupport, ColorSupport and CustomCssSupport traits.
string $name
- usernamestring $image = ''
- user imagestring $position = ''
- user role or positionstring $background = 'info'
- color of a card header (Bootstrap 4 colors or additional colors of AdminLTE) or a path to background imagebool $gradient = false
- makes a gradient card, uses $background propertyarray $cols = []
- list of columns, format: [title => text] (see an example below)string $textAlign = 'center'
- alignment of name and position ('left', 'right', 'center').
<?= UserCardWidget::widget([
'name' => 'Jonathan Burke Jr.',
'position' => 'Software developer',
'image' => '../avatars/user2-160x160.jpg',
'shadow' => 'shadow-sm',
'background' => 'navy',
'textAlign' => 'left',
'cols' => [
'PROJECTS' => '24',
'FOLLOWERS' => '1,521',
'TASKS' => '135',
'COMPLETED PROJECTS' => '12',
],
]); ?>
<?= UserCardWidget::widget([
'name' => 'Sarah Bullock',
'position' => 'UI/UX designer',
'image' => '../assets/img/user5-128x128.jpg',
'color' => 'white',
'shadow' => 'shadow-sm',
'background' => '../assets/img/photo1.png',
'textAlign' => 'right',
'cols' => [
'PROJECTS' => '16',
'FOLLOWERS' => '1,710',
'PRODUCTS' => '25',
],
]); ?>