承接 leoruhland/cakephp-resize 相关项目开发

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

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

leoruhland/cakephp-resize

Composer 安装命令:

composer require leoruhland/cakephp-resize

包简介

Resize plugin for CakePHP

README 文档

README

Note: This is a non-stable plugin for CakePHP 3.x at this time. It is currently under development and should be considered experimental.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require leoruhland/cakephp-resize

Now load the plugin:

bin/cake plugin load -r Resize

You are all set! Now call your resized images like domain.com/resize/200x200/img/myself.png. The img/myself.png should be located into your webroot.

Configuration

To configure the plugin, you should add to your app\bootstrap.php:

defaultSize (Default value: [100,100] )

Sets a defaultSize for invalid sizes.

Configure::write('Resize.defaultSize', [100, 100]);

sizes (Default value: [] )

Sets a array of allowed sizes to resize your images. (Fallback to defaultSize)

Configure::write('Resize.sizes', [100, 100]);

maxSize (Default value: [1920,1920] )

Sets a maxSize to resize your images. (Fallback to defaultSize)

Configure::write('Resize.maxSize', [1920, 1920]);

Usage

To resize a picture to 500x500, access the url of your picture(relative to webroot folder) prepending by resize/500x500/

Example using the HtmlHelper image method:

(In this case, you must go back one folder to access the root folder and not the images folder)

echo $this->Html->image('../resize/250x250/img/example.jpg');
echo $this->Html->image('../resize/250x250/uploads/articles/12/sample-article.jpg');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固