承接 trntv/yii2-glide 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

trntv/yii2-glide

最新稳定版本:1.2.2

Composer 安装命令:

composer require trntv/yii2-glide

包简介

Yii2 Glide Extension

README 文档

README

Yii2 Glide integration.

Glide is a wonderfully easy on-demand image manipulation library written in PHP.

Before you start read Glide documentation to understand what we are doing

Demo

Since this package was created as a part of yii2-starter-kit it's demo can be found in starter kit demo.

Contributing

You can contribute anything you found useful in any convenient way. Any help appreciated.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist trntv/yii2-glide

or add

"trntv/yii2-glide": "^1.0"

to the require section of your composer.json file.

Usage

Add glide configuration:

'components' => [
    ...
    'glide' => [
        'class' => 'trntv\glide\components\Glide',
        'sourcePath' => '@app/web/uploads',
        'cachePath' => '@runtime/glide',
        'signKey' => '<random-key>' // "false" if you do not want to use HTTP signatures
    ],
    ...
]

Then you can output modified image like so:

Yii::$app->glide->outputImage('new-upload.jpg', ['w' => 100, 'fit' => 'crop'])

You can also use trntv\glide\actions\GlideAction to output images: In any controller add (SiteController for example):

public function actions()
{
    return [
        'glide' => 'trntv\glide\actions\GlideAction'
    ]
}

Than use it: /index.php?r=site/glide?path=new-upload.jpg&w=100&h=75

Example

Complex Glide integration example can be found here

Secure Urls

TBD

统计信息

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

GitHub 信息

  • Stars: 41
  • Watchers: 6
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-04-08