Download the PHP package davidepastore/lorempixel-twig-extension without Composer
On this page you can find all versions of the php package davidepastore/lorempixel-twig-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download davidepastore/lorempixel-twig-extension
More information about davidepastore/lorempixel-twig-extension
Files in davidepastore/lorempixel-twig-extension
Download davidepastore/lorempixel-twig-extension
More information about davidepastore/lorempixel-twig-extension
Files in davidepastore/lorempixel-twig-extension
Vendor davidepastore
Package lorempixel-twig-extension
Short Description A Twig extension for the lorempixel service
License MIT
Package lorempixel-twig-extension
Short Description A Twig extension for the lorempixel service
License MIT
Please rate this library. Is it a good library?
Informations about the package lorempixel-twig-extension
LoremPixel Twig Extension
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:
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:
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
This library is released under the MIT license.
All versions of lorempixel-twig-extension with dependencies
PHP Build Version
Package Version
The package davidepastore/lorempixel-twig-extension contains the following files
Loading the files please wait ....