noccylabs/page2images-bundle

$ git tag


$ git branch
* master

NoccyLabs/Page2Images Bundle

Installation

Install via composer:

    $ composer require noccylabs/page2images-bundle:*

Then add the bundle to your AppKernel:

    ...
    new NoccyLabs\Page2Images\Page2ImagesBundle(),
    ...

Configuration Parameters

Add to your parameters.yml file:

    page2images_apikey: <rest-api-key>
    page2images_imgkey: <direct-link-image-key>
    page2images_api: <rest-or-direct>
    page2images_device: desktop
    page2images_size: 160x160

API selection

By specifying page2images_api: rest or page2images_api: direct you can lock the API being used. The differences are as follows:

Direct API

Restful API

Device selection

Size

The specified size is used as default if no size is specified for the url:

    {{ "http://www.google.com"|page2images }}

The size can always be overriden:

    {{ "http://www.google.com"|page2images("320x240") }}

As can the device:

    {{ "http://www.google.com"|page2images("400x800","phone") }}

Using

The filter page2images is used to return the appropriate URL to the specified URL.

    {{ page.getUrl()|page2images }}