necrox87 / yii2-avatar
Avatar management module
Requires
- php: >=7.0.0
- yiisoft/yii2-imagine: ^2.1.1
This package is auto-updated.
Last update: 2024-11-16 06:51:36 UTC
README
1.0.0 ALPHA
Allows upload of a custom avatar without dependency on any extension rather than yii2. Includes a widget to manage upload by users and management by admins.
The intention of this library is add the ability to upload a profile picture via a simple widget.
It must not be dependent from another user management library.
Usage
Add the module to your configuration like follows:
'modules' => [ 'avatar' => [ 'class' => 'eseperio\avatar\Module', 'adminPermission' => 'admin', ] ]
Now place the included widget where you want to display the avatar.
<?= \eseperio\avatar\widgets\Avatar::widget([ 'avatarId' => Yii::$app->user->id ]) ?>
Advanced configuration
Events
There are available some events.
JqueryPlugin
This module includes a custom made jquery plugin to manage the upload process.
You can configure it via widget through pluginOptions
There are many events available in the plugin. All events must return a boolean and have access to all the params of the parent function. See code to know more.