2017 © Pedro Peláez
 

symfony-bundle imagify-bundle

Symfony bundle for Imagify

image

ybert/imagify-bundle

Symfony bundle for Imagify

  • Wednesday, October 26, 2016
  • by ybert
  • Repository
  • 1 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

imagify-bundle

This bundle integrates Imagify PHP in the Symfony framework., (*1)

Installation

Use Composer to install the bundle:, (*2)

composer require ybert/imagify-bundle, (*3)

Then, update your app/config/AppKernel.php file:, (*4)

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Ybert\ImagifyBundle\YbertImagifyBundle(),
            // ...
        );

        return $bundles;
    }

Configure the bundle in app/config/config.yml:, (*5)

ybert_imagify:
    apiKey: %imagify_apiKey%

Finally, update your app/config/parameters.yml file to store your Imagify API credentials:, (*6)

parameters:
    # ...
    imagify_apiKey: MyAPIKey

Usage

The bundle automatically registers a ybert_imagify.optimizer service in the Dependency Injection Container. That service is an instance of Imagify\Optimizer., (*7)

Example usage in a controller:, (*8)

// ...

    public function optimizeImage()
    {
        /**
         * Get the Imagify service
         *
         * @var \Imagify\Optimizer $imagify
         */
        $imagify = $this->get('ybert_imagify.optimizer');
        $param = array(
            "level"=> 'ultra',
            "resize"=> array("width"=> 50),
        );
        $image = '1.jpg';
        $result = $imagify->optimize($image, $param);
    }

// ...
}

For further use, please read the Imagify API documentation

The Versions

26/10 2016

dev-master

9999999-dev

Symfony bundle for Imagify

  Sources   Download

MIT

The Requires

 

The Development Requires

image resize optimize imagify

26/10 2016

V1.0.0

1.0.0.0

Symfony bundle for Imagify

  Sources   Download

MIT

The Requires

 

The Development Requires

image resize optimize imagify

14/10 2016

v0.1

0.1.0.0

Symfony bundle for Imagify

  Sources   Download

MIT

The Requires

 

The Development Requires

image resize optimize imagify