app-zap / phpframework-placeimg
Requires
- app-zap/phpframework: dev-develop
This package is auto-updated.
Last update: 2024-11-29 04:19:46 UTC
README
This package is intended to be used with the PHPFramework.
What it does
It provides a function that returns HTML placeholder image tags and is built to be used as twig function.
How to use
Use {{ placeimg(300, 200) }}
in your twig templates and will get a ready-to-use img tag (e.g. <img src="http://lorempixel.com/300/200" />
) with a dummy image.
Optionally you can provide additional attributes as a third parameter: {{ placeimg(300, 200, 'class="mainimage"')}}
.
Example:
You just want an image url? Try {{ placeimg_url(300, 200) }}
!
Configuration
Via settings.ini
you can choose between different image placeholder providers.
[application]
placeimg_provider = "placebear"
The following providers are supported at the moment:
baconmockup
- baconmockup.comdummyimage
- dummyimage.comfakeimg
- fakeimg.plfillmurray
- fillmurray.comlorempixel
- lorempixel.com (default)nicenicejpg
- nicenicejpg.comp-hold
- p-hold.complace-hoff
- place-hoff.complacebear
- placebear.complacebeard
- placebeard.complacecage
- placecage.complacehold
- placehold.itplaceimg
- placeimg.complacesheen
- placesheen.comstevensegallery
- stevensegallery.comunsplash
- unsplash.it
Disclaimer
Please notice that I don't run these providers and there's no guarantee that they will be available for ever.
If you notice that one of these providers is offline very frequently -or even for ever- please open an issue.
If you know a provider that's missing please open an issue.