kappa/thumbnails-helper 问题修复 & 功能扩展

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

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

kappa/thumbnails-helper

最新稳定版本:v1.0.1

Composer 安装命令:

composer require kappa/thumbnails-helper

包简介

Simple and intelligent system for creating and work with thumbnails

README 文档

README

Simple and intelligent system for creating and work with thumbnails

Requirements:

Installation

The best way to install Kappa\ThumbnailsHelper is using Composer:

$ composer require kappa/thumbnails-helper:@dev

Usages

You must register extension:

extensions:
	thumb: Kappa\ThumbnailsHelper\DI\ThumbnailsHelperExtension

Into presenter or control where you can use this helper add filter (helper)

$template->addFilter('thumb', array($this->thumbnailsHelper, 'process')) // for Nette 2.2
$template->registerHelper('thumb', array($this->thumbnailsHelper, 'process')) // for Nette 2.1

Method in callback must be process()!

and you can use helper in templates

<img src="{$photo|thumb:'100x300':'fit'}">

Size can be in next formats:

  • 100x - Width will be 100px and height will be automatically calculated
  • x100 - Width will be automatically calculated and height will be 100px
  • 100x100 - Size will be 100pxx100px

Third argument is resize type, for more info see documentation in czech only

Helper can be configure in config:

  • thumbDir: - set path to thumb dir with %wwwDir% (example %wwwDir%/thumbs)
  • sizeUp - you can set to true or false when you want small image resize to big image
  • controlFrequency - you can set count of days for invalidate storage (remove all thumbnails and create a new only from usages images). If you set this option on false or remove option automatically control has been disabled

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-01-27