PHPackages                             cb-techservices/yii2-unsplash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cb-techservices/yii2-unsplash

ActiveYii2-extension

cb-techservices/yii2-unsplash
=============================

This extension provides a Yii2 widget to display an image picker powered by Unsplash images API.

1262PHP

Since Sep 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/cb-techservices/yii2-unsplash)[ Packagist](https://packagist.org/packages/cb-techservices/yii2-unsplash)[ RSS](/packages/cb-techservices-yii2-unsplash/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Unsplash Extension
=======================

[](#yii2-unsplash-extension)

This extension provides a Yii2 widget to display an image picker powered by Unsplash images API.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist cb-techservices/yii2-unsplash "*"

```

or add

```
"cb-techservices/yii2-unsplash": "*"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Add the following to your main.php config file in your Yii project.

**REQUIREMENT:** You must have a valid [developer account](https://unsplash.com/documentation#getting-started) and "App" set up with [Unsplash](https://unsplash.com) API. Once created, use the app's Access Key and the UTM Source (aka Application Name) for your Yii configuration.

```
'modules' => [
	'unsplash' => [
        'class' => 'cbtech\unsplash\UnsplashImagePickerModule',
        // ... other configurations for the module ...
        'params'=>[
        	'applicationId'	=> '{ACCESS_KEY}',
        	'utmSource' => '{UTM_SOURCE}',
        ]
    ],
],

```

Usage
-----

[](#usage)

Once the extension AND module are installed, simply use it in your code by :

```

```

Use Javascript and jQuery to listen for the 'unsplashDownload' event.

```
$(document).bind('unsplashDownload',"#unsplash-results",function(event, data){
	console.log("Download Url = = " + data.downloadUrl);
	console.log("All photo view urls = = " + data.urls);

	$.ajax({
		"method":"POST",
		"url":"/project/save-user-project-media-url-ajax",  //This is a custom PHP script that recieves the download URL of the photo and downloads it to the server.
		"data":{downloadUrl: data.downloadUrl}
	}).done(function(response){
		$(".file-default-preview").empty().html("");
	});
});
```

Example PHP action that receives the downloadUrl:

```
public function actionSaveUserProjectMediaUrlAjax(){
	$downloadUrl = \Yii::$app->request->post("downloadUrl"); //Download URL sent via $_POST
	//Do something with the downloadUrl, like use it to download a copy of the photo to your server.
}
```

[![Image of Yii2 Unsplash Image Picker](./screenshots/Screenshot1.png)](./screenshots/Screenshot1.png)

Acknowledgments
---------------

[](#acknowledgments)

- Official Unsplash [PHP Library](https://github.com/unsplash/unsplash-php)
- [Unsplash Developer API](https://unsplash.com/developers)
- [Yii2 Framework](https://github.com/yiisoft/yii2) [![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)

License
-------

[](#license)

Yii2 Unsplash Extension is available under the MIT license. See the LICENSE file for more info.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1236ca47a3c0947738414ae1d24aa96c281e847f447ea03180ba058c19977677?d=identicon)[carlb0329](/maintainers/carlb0329)

---

Top Contributors

[![carlb0329](https://avatars.githubusercontent.com/u/10040482?v=4)](https://github.com/carlb0329 "carlb0329 (26 commits)")

---

Tags

image-pickerunsplashunsplash-apiyii2-extension

### Embed Badge

![Health badge](/badges/cb-techservices-yii2-unsplash/health.svg)

```
[![Health](https://phpackages.com/badges/cb-techservices-yii2-unsplash/health.svg)](https://phpackages.com/packages/cb-techservices-yii2-unsplash)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
