Class vitalik74\primer\Avatar
| Inheritance | vitalik74\primer\Avatar » yii\base\Object |
|---|
Provide show avatar.
Example use in your view:
<?php
use vitalik74\primer\Avatar;
?>
<div class="site-avatar">
<?= Avatar::avatar('//avatar.jpg', ['width' => 30, 'height' => 80]) ?>
<?= Avatar::avatarSmall('//avatar.jpg', ['width' => 30, 'height' => 80]) ?>
<?= Avatar::avatarParent([
'parent' => [
'src' => '//avatar.jpg',
'options' => [
'width' => 30,
'height' => 80,
'id' => 'parent_avatar']
],
'child' => [
'src' => '//avatar2.jpg',
'options' => [
['width' => 15, 'height' => 40]
]
]
], 'left') ?>
</div>
See also [[@see]] http://primercss.io/avatars/.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| avatar() | Return img Html-code with avatar | vitalik74\primer\Avatar |
| avatarParent() | Return img Html-code with avatar and child | vitalik74\primer\Avatar |
| avatarSmall() | Return img Html-code with avatar small | vitalik74\primer\Avatar |
Method Details
Return img Html-code with avatar
| string avatar( $src, $options = [], $type = '' ) | ||
| $src | string | Path to avatar |
| $options | array | Keys-values pair of options use in \yii\helpers\Html::tag() |
| $type | string | Possible values 'avatar-small' or '' |
Return img Html-code with avatar and child
| string avatarParent( $options, $positionChild = 'left' ) | ||
| $options | ||
| $positionChild | string | Position child. Possible values |
Return img Html-code with avatar small
| string avatarSmall( $src, $options = [] ) | ||
| $src | string | Path to avatar |
| $options | array | Keys-values pair of options use in \yii\helpers\Html::tag() |