kreyu/placeholder-image
Composer 安装命令:
composer require kreyu/placeholder-image
包简介
Generate links for placeholder images using various providers
README 文档
README
This package helps with usage of various placeholder image providers.
Zero dependencies, simple links.
Installation
You can install the package via composer:
composer require kreyu/placeholder-image
Testing
composer test
Usage
To generate the url placeholder image:
PlaceholderImage::with($providerAlias)->generate($width, $height, array $options, $ssl = true);
Example usage:
PlaceholderImage::with('dummy_image')->generate(600, 400, [ 'text' => 'Beep Boop', 'format' => 'png', 'background' => 'FF9900', 'foreground' => 'FFFFFF', ]);
Will give us the following url:
https://dummyimage.com/600x400/FF9900/FFFFFF.png&text=Beep+boop
Fourth argument allows to disable SSL support.
Supported providers
fill_murray- fillmurray.comdummy_image- dummyimage.complaceholder- placeholder.complace_img- placeimg.com
Using the invalid provider alias throws the InvalidProviderException
Fatal error: Uncaught Kreyu\PlaceholderImage\Exception\InvalidProviderException:
Requested provider invalid-prov does not exist.
License
The MIT License (MIT). Please see license file for more information.
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-23