Download the PHP package eseperio/yii2-avatar without Composer

On this page you can find all versions of the php package eseperio/yii2-avatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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

Add the module to your configuration like follows:

Now place the included widget where you want to display the avatar.

Advanced configuration
Param Default Description
$avatarFileName null The 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 closure
defaultImage false array the path to default image
createDirectories true whether create the target directories if they do not exists.
thumbWidth 250 size of thumbnail size
thumbHeight 250 size of thumbnail size
outputFormat 2 (jpeg) Format for generated images
keepOriginal true whether keep the original uploaded file
originalSuffix 'or' suffix to be appended to original files. If keep original enabled
uploadDir '@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 slash
attributeName 'image' name of the attribute to be used on forms
imageValidator see code name of the attribute to be used on forms validator to be used for image uploaded
mimeTypes see code list of allowed mimetypes
glue '_' to be used when joining avatar name parts
adminPermission null users with this permissions will be able to update avatars from other users.

Events

There are available some events.

Event Description
UploadEvent::EVENT_AFTER_UPLOAD Triggered just after saving original image. Use this event to generate thumbnails in other sizes.

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

Name Description
beforeUpload Triggered on the beforeSend event
afterUpload Triggered when ajax response is full ok (status code and server response)
onFail Triggered when status code is 200 but server response is not ok
onAjaxFail Triggered when communication with server fails

All versions of yii2-avatar with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
yiisoft/yii2-imagine Version ^2.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eseperio/yii2-avatar contains the following files

Loading the files please wait ....