Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 59 | | All time: 10,372 This week: 82 |
|
Description | | Author |
This class can display images from Unsplash.com.
It can take the image identifier of a image from Unsplash.com and generates a URL for an image that can be include in a Web page with img tag.
The class can also take other parameters for the image like the width and height, automatic fit, quality and device pixel ratio. | |
 |
|
Innovation award
 Nominee: 16x
Winner: 3x |
|
Details
Unsplash Helper
Get Unsplash Images Easily
Get easily any Unsplash images with a clean PHP class.
It's a really lightweight and simple PHP class that helps you to get easily any images from Unsplash.com while keeping your project clean.
Example
use PH7\Image\Unsplash;
$unsplash = new Unsplash();
$unsplash->setWidth(600)
->setHeight(400)
->setQuality(80)
->setImageId('photo-1462045504115-6c1d931f07d1');
echo '<img src="' . $unsplash->getImage() . '">';
$unsplash->setImageId('photo-1500045992661-f978470eaf7b');
$unsplash->setFit(Unsplash::MAX_FIT);
echo '<img src="' . $unsplash->getImage() . '">';
Installation
-
Install Composer (https://getcomposer.org)
-
Include it in your project:
composer require ph-7/image-unsplash
Requirements
Author
Made with ? and care by Pierre-Henry Soria
License
MIT License. Enjoy! :smiley:
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.