gregleveque/ez-progressive-image-bundle
Composer 安装命令:
composer require gregleveque/ez-progressive-image-bundle
包简介
Display images like Medium with a low resolution placeholder.
README 文档
README
A bundle for EzPlatform to display images like Medium.
Instalation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require gregleveque/ez-progressive-image-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
// app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Gie\EzProgressiveImageBundle\EzProgressiveImageBundle(), ); // ... } // ... }
Usage example
{{ ez_render_field(content, 'image', {
'parameters': {
'alias': 'original', 'class': 'img-fluid w-100'}
}) }}
Parameters
| Parameter | Type | Description |
|---|---|---|
| alias | string | Defaults to "original" (e.g. image originally uploaded) |
| class | string | Allows setting CSS custom class name for the figure element |
| width | int, string | Allows forcing width of the image in the HTML |
| height | int, string | Allows forcing height of the image in the HTML |
| exact | bool | Allows forcing height and width of the 'alias' to the figure element |
| caption | string | Allows adding a caption to the figure element |
| alt | string | Allows adding an alternative text on img elements |
| link | object | Allows setting a link on the figure element |
| * href | string | |
| * title | string | |
| * target | string |
统计信息
- 总下载量: 205
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-25