microstudi/silex-image-controller 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

microstudi/silex-image-controller

最新稳定版本:v2.0.2

Composer 安装命令:

composer require microstudi/silex-image-controller

包简介

Microstudi/Image Controller Service Provider for Silex.

README 文档

README

A auto-image resize controller using Intervention/image service provider for Silex

Downloads Travis status License

Requirements

Install

Using composer:

composer require microstudi/silex-image-controller

Usage

use Microstudi\Silex\ImageController\ImageController;
use Microstudi\Silex\InterventionImage\InterventionImageServiceProvider;

$app = new Silex\Application();
$app->register(new InterventionImageServiceProvider);
      ;

//Automatic images
$app->mount('/your_path', new ImageController(array(
                'image_path' => '/path/to/original/images',
                'image_cache_path' => '/path/to/cache/folder'
            ) ));

$app->run();

Twig Helper: If twig is present a convenient function can be used to generate proper urls for auto-resized images image_path(image, size):

{{ image_path('path/to/image.png', 100, 100) }}
{{ image_path('path/to/image.png', 100, 100, 'c') }}

URLs examples:

your_path/200x300/products/image_product.jpg    <- width or height will be
                                                   changed if necessary but
                                                   never increased
your_path/200x300xc/products/image_product.jpg  <- cropped, ensures exact sizes
your_path/200x0/products/image_product.jpg      <- auto-calculate height
your_path/0x300/products/image_product.jpg      <- auto-calculate width

Options

  • intervention.image - Instance of Intervention\Image\ImageManager.
  • intervention.response - For use ImageManager directly such as $app['intervention.response']($image)
  • intervention.driver - Driver used (imagick or gd)

Tests

$ composer install
$ vendor/bin/phpunit

Changelog

2.0.2

  • README example fix.

2.0.0

  • Updated for Silex 2.0

1.0.1

  • Readme fix
  • Locked Silex to version 1.1

1.0.0

  • First release

LICENSE

The MIT LICENSE (MIT)

统计信息

  • 总下载量: 2.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-29