davidepastore/lorempixel-twig-extension 问题修复 & 功能扩展

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

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

davidepastore/lorempixel-twig-extension

Composer 安装命令:

composer require davidepastore/lorempixel-twig-extension

包简介

A Twig extension for the lorempixel service

README 文档

README

Latest version Build Status Coverage Status Quality Score Total Downloads PSR2 Conformance

This library integrates LoremPixel service into Twig. You can use it to generate random image urls that you can use as placeholders in your application.

Installation

composer require "davidepastore/lorempixel-twig-extension"

Usage

Add LoremPixelTwigExtension to your Twig extensions:

$twig->addExtension(new LoremPixelTwigExtension());

In the templates, you then just call <img src="{{ lorempixel() }}">.

You can use different parameters for this function in this order:

Name Type Description Default Example
gray boolean Is it a gray image? false lorempixel(true)
width int The width of the image. 400 lorempixel(true, 500)
height int The height of the image. 200 lorempixel(true, 500, 300)
category string The category of the image. You can find all supported categories here. null lorempixel(true, 500, 300, 'cats')
number int The number of the image from the given category. null lorempixel(true, 500, 300, 'cats', 2)
text string The custom text to add to the image. null lorempixel(true, 500, 300, 'cats', 2, 'Dummy Text')

An example with all the parameters could be:

<img src="{{ lorempixel(true, 500, 300, 'cats', 2, 'Dummy Text') }}">

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

This library is released under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固