Download the PHP package circulon/yii2-images without Composer

On this page you can find all versions of the php package circulon/yii2-images. 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-images

yii2-images

Yii2-images is yii2 module that allows attachment of images to any model, you can also retrieve images in any sizes. Additionally you can set the main (default) image of a group of images.

Module supports Imagick and GD libraries, you can set up it in module settings.

Features

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist circulon/yii2-images "*"

or add

"circulon/yii2-images": "*"

to the require section of your composer.json file.

Run the migration

Setup

add the module setup to your app config

'modules' => [
    ...
    'images' => [
        'class' => 'circulon\images\Module',
        // be sure, that permissions ok 
        // if you cant avoid permission errors you have to create "images" folder in web root manually and set 777 permissions
        'imagesStorePath' => 'images/store', //path to origin images
        'imagesCachePath' => 'images/cache', //path to resized copies
        'graphicsLibrary' => 'GD', //but really its better to use 'Imagick' 
        'placeholderPath' => '@webroot/images/placeholder.png', // if you want to get placeholder when image not exists, string will be processed by Yii::getAlias
    ],
],

optionally add the url route to the UrlManager

NOTE : you may need to add a similar rule to your module/s that have this attached action

'components' => [
    ...
    'urlManager' => [
      'enablePrettyUrl' => true,
      'showScriptName' => false,
      'rules' => [
          ...

          '<controller:\w+>/<action:\w+>/<id:\d+>/<ref:[a-z0-9_-]+>' => '<controller>/<action>',

          ...
       ],
    ],
    ...
]

attach the behavior to your model/s

add the action to the required controllers

Usage

with an img tag

Details

  1. Get images

  2. Remove image/images

  3. Set main/default image

  4. Get image sizes

  5. Get original image

  6. Get raw image content or encoded content

    
    $image = $model->getImage();
    $content = $model->getContent();
    
    // output base64 encoded thumbnail with bootstrap3 css
    echo '<img class="img-responsive img-rounded" src="data:image/png;base64,'.$user->getImage()->getContent('50x50', true).'" alt="">';

All versions of yii2-images with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
abeautifulsite/simpleimage Version *
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 circulon/yii2-images contains the following files

Loading the files please wait ....