emanueleminotto/embedly-module

Embed.ly module for Zend Framework 2

1.1.0 2015-03-07 12:59 UTC

This package is auto-updated.

Last update: 2021-11-28 00:38:05 UTC


README

Build Status SensioLabs Insight Coverage Status Scrutinizer Code Quality Total Downloads

An embed.ly module for Zend Framework 2 based on the Embedly library.

API: emanueleminotto.github.io/EmbedlyModule

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this module:

$ composer require emanueleminotto/embedly-module

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

// EmanueleMinotto\Embedly\Client instance
$embedly = $this->getServiceLocator()->get('embedly');

Configuration

The module doesn't need a configuration to be used, but you can add an API key and a reference to a Guzzle 5 client.

return array(
    'embedly' => array(
        'api_key' => 'xxxxxxxx',
        'http_client' => 'guzzle_client_service_reference',
    ),
);

View Helper

A view helper is provided in this module, the method embedlyDisplay works like the library display method (ref).

<img src="<?php echo $this->embedlyDisplay('resize', [
    'url' => 'http://placehold.it/500',
    'width' => 100,
    'height' => 100,
]); ?>" />