https://github.com/samcrosoft/php-placeholder-lumen
This is a lumen project using the samcrosoft/placeholder package to create image placeholders
https://github.com/samcrosoft/php-placeholder-lumen
Last synced: 3 months ago
JSON representation
This is a lumen project using the samcrosoft/placeholder package to create image placeholders
- Host: GitHub
- URL: https://github.com/samcrosoft/php-placeholder-lumen
- Owner: samcrosoft
- License: mit
- Created: 2015-06-01T15:58:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-03T11:29:23.000Z (about 10 years ago)
- Last Synced: 2025-01-29T12:30:19.228Z (5 months ago)
- Language: PHP
- Size: 156 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP-Placeholder-Lumen
This is a lumen project using the [samcrosoft/placeholder] (http://samcrosoft.github.io/Placeholder/) package to create image placeholders### Where the magic happens
```php
use Samcrosoft\Placeholder\Placeholder;$app->get('/', function() use ($app) {
$oPlaceholder = new Placeholder();
/*
* Create the placeholder image
*/
$oImage = $oPlaceholder->makePlaceholderFromURL();ob_start();
imagepng($oImage);
imagedestroy($oImage);$oImageContent = ob_get_contents();
ob_end_clean();return response($oImageContent, 200)
->header('Content-Type', "image/png");//return $app->welcome();
});```
**Note** the use of output buffering, this is just to allow lumen to be able to respond with the image.