PHPackages                             eseperio/yii2-avatar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. eseperio/yii2-avatar

ActiveYii2-extension[Image &amp; Media](/categories/media)

eseperio/yii2-avatar
====================

Avatar management module

1.0.1(2y ago)24303[1 issues](https://github.com/Eseperio/yii2-avatar/issues)MITPHPPHP &gt;=7.1.0

Since Mar 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Eseperio/yii2-avatar)[ Packagist](https://packagist.org/packages/eseperio/yii2-avatar)[ RSS](/packages/eseperio-yii2-avatar/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

yii2 avatar
===========

[](#yii2-avatar)

**1.0.0**

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
-----

[](#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.

```

```

##### Advanced configuration

[](#advanced-configuration)

ParamDefaultDescription$avatarFileNamenullThe name to be used on generated files. If `null` then id property from `userComponent` will be used. If it is a string then will be considered like a route to a property within `userComponent`. If can be also a closure or a reference to a class method. Signature of method must be `function($id, $module){}`. See source code for more information.userComponent`'user'`component to be used when generating avatar id. Ignored if $avatarFilename is a closuredefaultImage`false`array the path to default imagecreateDirectories`true`whether create the target directories if they do not exists.thumbWidth`250`size of thumbnail sizethumbHeight`250`size of thumbnail sizeoutputFormat`2` (jpeg)Format for generated imageskeepOriginal`true`whether keep the original uploaded fileoriginalSuffix`'or'`suffix to be appended to original files. If keep original enableduploadDir`'@app/uploads'`directory to store thumbs generated without trailing slash. You can set a non web visible folder and get the pictures via link to `['/avatar/default/picture','id'=> $id ]`.thumbsDir`'@app/images/thumbs'`directory where the files will be uploaded without trailing slashattributeName`'image'`name of the attribute to be used on formsimageValidatorsee codename of the attribute to be used on forms validator to be used for image uploadedmimeTypessee codelist of allowed mimetypesglue`'_'`to be used when joining avatar name partsadminPermission`null`users with this permissions will be able to update avatars from other users.Events
------

[](#events)

There are available some events.

EventDescription`UploadEvent::EVENT_AFTER_UPLOAD`Triggered just after saving original image. Use this event to generate thumbnails in other sizes.JqueryPlugin
------------

[](#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.

#### Available events in jQuery plugin

[](#available-events-in-jquery-plugin)

NameDescriptionbeforeUploadTriggered on the beforeSend eventafterUploadTriggered when ajax response is full ok (status code and server response)onFailTriggered when status code is 200 but server response is not okonAjaxFailTriggered when communication with server fails

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~770 days

Total

2

Last Release

751d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1e173755eb4a5abae378ed4c8a8e8066f578c3192105c5e3f9b8ea3ef0086e7?d=identicon)[Eseperio](/maintainers/Eseperio)

---

Top Contributors

[![Eseperio](https://avatars.githubusercontent.com/u/5459366?v=4)](https://github.com/Eseperio "Eseperio (27 commits)")

---

Tags

imageuserprofilebackendavataryii2-useryii 2pictureaccountyii frameworkyii2 usuario

### Embed Badge

![Health badge](/badges/eseperio-yii2-avatar/health.svg)

```
[![Health](https://phpackages.com/badges/eseperio-yii2-avatar/health.svg)](https://phpackages.com/packages/eseperio-yii2-avatar)
```

###  Alternatives

[multiavatar/multiavatar-php

Multicultural Avatar Generator

653150.0k4](/packages/multiavatar-multiavatar-php)[2amigos/yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension

298275.5k14](/packages/2amigos-yii2-usuario)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16625.8k2](/packages/gravatarphp-gravatar)[sitegeist/sms-responsive-images

Provides ViewHelpers and configuration to render valid responsive images based on TYPO3's image cropping tool.

34493.1k2](/packages/sitegeist-sms-responsive-images)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
