Since v0.4
Pay attention! You should use echo
and widget()
method when you work with the widget. It uses CardToolsSupport, ShadowSupport, ColorSupport and CustomCssSupport traits.
string $name
- usernamestring $image = ''
- user imagestring $position = ''
- user role or position (title of a card)array|string $about = ''
- about user. format: array ['Web Designer', 'UX'] or stringstring $aboutTitle = 'About: '
- about titlestring $aboutSeparator = ' / '
- separator of about user if it is an arrayarray $info = []
- list of rows. format: FontAwesome icon => textbool $outline = false
- makes an outlined cardstring|array $footer = ''
- content of card footer, it can be some string or an array of buttons
<?= ContactCardWidget::widget([
'name' => 'Jonathan Burke Jr.',
'position' => 'Software Engineer',
'image' => '../avatars/user2-160x160.jpg',
'color' => 'info',
'outline' => true,
'close' => true,
'aboutTitle' => 'Skills: ',
'about' => ['Web Designer', 'UX', 'Graphic Artist', 'Coffee Lover'],
'info' => [
'fa-building' => 'Address: Demo Street 123, Demo City 04312, NJ',
'fa-phone' => 'Phone #: <a href="tel:+80012122352">+ 800 - 12 12 23 52</a>',
'fa-envelope' => 'Email: <a href="mailto:[email protected]">[email protected]</a>',
],
'footer' => [
[
'<i class="fas fa-comments"></i>',
'bg-teal',
['update', 'id' => 1],
[],
],
[
'<i class="fas fa-user"></i> View profile',
'btn-primary',
'#profile',
[],
],
],
]); ?>