Coder Social home page Coder Social logo

ph-7 / image-unsplash Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 2.0 13 KB

:framed_picture: Get easily any Unsplash images with a clean PHP class. It's a really lightweight class that helps to get easily any images from Unsplash.com while keeping your project clean.

Home Page: https://github.com/pH-7/Image-Unsplash

PHP 100.00%
lightweight unsplash library photos php71 php-71 unsplash-api unsplash-helper image picture

image-unsplash's Introduction

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

  1. Install Composer (https://getcomposer.org)
  2. 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! ๐Ÿ˜ƒ

image-unsplash's People

Contributors

ph-7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.