PHPackages                             necrox87/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. necrox87/yii2-avatar

ActiveLibrary[Image &amp; Media](/categories/media)

necrox87/yii2-avatar
====================

Avatar management module

1.0.2(7y ago)01511MITPHPPHP &gt;=7.0.0

Since Dec 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/marcogermani87/yii2-avatar)[ Packagist](https://packagist.org/packages/necrox87/yii2-avatar)[ RSS](/packages/necrox87-yii2-avatar/feed)WikiDiscussions master Synced today

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

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

[](#yii2-avatar)

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

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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.4% 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 ~15 days

Total

3

Last Release

2674d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce977c0b2a8b5671f3a9bc015b9f35520681dc278870e7ea04b233269f07a33?d=identicon)[marcogermani87](/maintainers/marcogermani87)

---

Top Contributors

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

---

Tags

imageuserprofilebackendavataryii2-useryii 2pictureaccountyii frameworkyii2 usuario

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/necrox87-yii2-avatar/health.svg)](https://phpackages.com/packages/necrox87-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)
