jdecool/image-workshop-bundle

该包已被废弃,不再维护。未建议替代包。

为ImageWorkshop实现Symfony2的bundle

安装: 567

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:bundle

1.0.0 2016-02-27 13:03 UTC

This package is not auto-updated.

Last update: 2020-01-24 15:34:36 UTC


README

Build Status Latest Stable Version

Symfony2 bundle实现ImageWorkshop

安装

使用composer安装该bundle

{
    "require": {
        "jdecool/image-workshop-bundle": "~1.0"
    }
}

在应用的AppKernel中启用扩展

<?php

public function registerBundles()
{
    $bundles = [
        // ...
        new JDecool\Bundle\ImageWorkshopBundle\ImageWorkshopBundle(),
    ];

    // ...

    return $bundles;
}

## Twig过滤器

<img src="{{ 'path/to/image/file.png'|image_filter('image_format') }}">

配置参考

image_workshop:
    cache:
        lifetime: 86400 # 1 day
        prefix:   media/cache

    formats: ~

图像格式定义

image_workshop:
    cache:
        lifetime: 86400 # 1 day
        prefix:   media/cache

    formats:
        thumbnail:
            width:  200
            height: 300

        profile:
            width:  500
            height: 500