Download the PHP package imbo/imbo-zf2 without Composer
On this page you can find all versions of the php package imbo/imbo-zf2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imbo/imbo-zf2
More information about imbo/imbo-zf2
Files in imbo/imbo-zf2
Package imbo-zf2
Short Description Imbo module for Zend Framework 2
License MIT
Homepage http://www.imbo-project.org/
Informations about the package imbo-zf2
Imbo module for Zend Framework 2
This module introduces an Imbo client service, and a view helper for creating Imbo image URLs in Zend Framework 2 applications.
Installation
Add imbo/imbo-zf2-module
to your composer.json
file, and enable the module in your application.config.php
file:
Configuration
The module has some configuration options that you will need to set, and all options are under the imboModule
key in the configuration array.
Client configuration
To configure the ImboClient instance you need to specify one or more hosts, a user and a public/private key pair:
View helper transformation presets
The view helper supports presets specified in the configuration array if you want easier access to custom transformation chains:
See below on how to trigger these presets in your view scripts.
Usage
Injection via the initializer
The module ships with a controller initializer that looks for controllers that implement the Imbo\Service\ImboClientAwareInterface
interface. Whenever such a controller is found, the setImboClient()
method will be called with an instance of ImboClient\ImboClient
, fetched from the service manager. The interface also defines a getImboClient()
method that whould return the client instance.
The module also includes a trait that implements both these methods, so if you have a controller that needs access to an Imbo client, you will only need to add a couple of lines:
All you need to do is have your controller implement the interface and use
the trait, and Zend Framework will automatically inject the Imbo client for you.
Client service
The service is simply called ImboClient
and can be fetched from the main service manager.
View helper
The view helper can be used in your view scripts like this:
For a complete list of available transformations, see the client documentation.
Transformation presets
Transformation presets specified in the configuration can be referred to in the view scripts by specifying a second parameter to the view helper:
See how to configure transformation presets in the configuration section above.
All versions of imbo-zf2 with dependencies
imbo/imboclient Version ~2.0
zendframework/zend-modulemanager Version ~2.2
zendframework/zend-servicemanager Version ~2.2
zendframework/zend-view Version ~2.2