drishu/yii2-imagecache 问题修复 & 功能扩展

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

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

drishu/yii2-imagecache

最新稳定版本:1.0.6

Composer 安装命令:

composer require drishu/yii2-imagecache

包简介

the better image cache

README 文档

README

the better image cache

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist drishu/yii2-imagecache "*"

or add

"drishu/yii2-imagecache": "*"

to the require section of your composer.json file.

imageCache component config

You should add imageCache component in your application configuration :

$config = [
    'components' => [
      ...
      'imagecache' => [
        'class' => 'drishu\yii2imagecache\ImageCache',
        // the below paths depend very much on your image upload setup
        'sourcePath' => Yii::getAlias('@base'), // base path to your uploads dir
        'cachePath' => '/data', // relative path to your uploads dir
      ],
      ...
    ],
];

Usage

In your view, controller, component, etc. just call :

<?= Html::img(Yii::$app->imagecache->get($image->path, '0x160'))?>```

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GNU-2.0
  • 更新时间: 2015-07-09