2017 © Pedro Peláez
 

library lorempixel-twig-extension

A Twig extension for the lorempixel service

image

davidepastore/lorempixel-twig-extension

A Twig extension for the lorempixel service

  • Sunday, August 14, 2016
  • by DavidePastore
  • Repository
  • 1 Watchers
  • 2 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

LoremPixel Twig Extension

Latest version [![Build Status][ico-github-actions]][link-github-actions] Coverage Status ![Quality Score][ico-code-quality] Total Downloads PSR2 Conformance, (*1)

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., (*2)

Installation

composer require "davidepastore/lorempixel-twig-extension"

Usage

Add LoremPixelTwigExtension to your Twig extensions:, (*3)

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

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

You can use different parameters for this function in this order:, (*5)

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:, (*6)

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

Testing

bash $ phpunit, (*7)

Contributing

Please see CONTRIBUTING for details., (*8)

Credits

License

This library is released under the MIT license., (*9)

The Versions

14/08 2016

dev-master

9999999-dev

A Twig extension for the lorempixel service

  Sources   Download

MIT

The Requires

 

The Development Requires

twig image random lorem pixel img lorempixel

14/08 2016

v0.1.1

0.1.1.0

A Twig extension for the lorempixel service

  Sources   Download

MIT

The Requires

 

The Development Requires

twig image random lorem pixel img lorempixel

12/08 2016

v0.1.0

0.1.0.0

A Twig extension for the lorempixel service

  Sources   Download

MIT

The Requires

 

The Development Requires

twig image random lorem pixel img lorempixel