定制 jbouzekri/phumbor-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jbouzekri/phumbor-bundle

最新稳定版本:4.0.0

Composer 安装命令:

composer require jbouzekri/phumbor-bundle

包简介

A Symfony Bundle to use the minimal Thumbor PHP client from webfactory/phumbor

README 文档

README

Tests

A Symfony Bundle to generate Thumbor image URLs, using the PHP client from webfactory.

Prerequisites

Of course, you must have a Thumbor server installed and operationnal. If not, you can follow the official installation documentation.

Installation

Add jbouzekri/phumbor-bundle as a dependency in composer.json.

"jbouzekri/phumbor-bundle": "^3.0"

Enable the bundle in your AppKernel :

$bundles = array(
    ...
    new Jb\Bundle\PhumborBundle\JbPhumborBundle()
);

In your config.yml, configure at least the url of your Thumbor server and the secret :

jb_phumbor:
    server:
        url: http://localhost
        secret: 123456789

Alternatively, you can also set the environment variables THUMBOR_URL and THUMBOR_SECURITY_KEY for these two settings, for example from your .env file or from inside your webserver configuration.

Quick use case

You need to resize the image of your article to fit in a square of 50x50. Define the following transformation in your config.yml :

jb_phumbor:
    transformations:
        article_list:
            fit_in: { width: 50, height: 50 }

Now you can use it in twig :

{{ thumbor(<the absolute url of your image>, 'article_list') }}

Documentation

License

MIT - see LICENSE

统计信息

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

GitHub 信息

  • Stars: 25
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-04-17