Published: 09 Feb 2018 › Updated: 09 Feb 2018
PhotonBundle for Symfony
Photon for Symfony
Photon is an image acceleration and modification service for Jetpack-connected WordPress sites.
To use in symfony, PhotonBundle uses Photon Wrapper
compatibility Symfony 3.x, 4.x
Installation
composer require bencagri/photon-bundle
Then register the bundle in app/AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
....
//Photon Bundle
new \Bencagri\PhotonBundle\PhotonBundle(),
];
Thats it.
Usage
There is a service that you can use in Symfony.
in your controller;
use Photon\Wrapper\Effect\Filter;
use Photon\Wrapper\Effect\Width;
use Photon\Wrapper\Effects;
...
public function indexAction(Request $request)
{
//get the service
$generator = $this->get('bencagri.photon.service');
//register the effects that you want to use
$effects = new Effects(
new Width(700),
new Filter('emboss')
);
$imageUrl = 'https://images.com/my.jpg';
//generate the picture
$generator->generate($imageUrl,$effects);
}
See all effects that you can use on Photon Wrapper examples.
Contribute
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
Licence
- The Photon Bundle is open-sourced software licensed under the MIT license.
- The Photon Wrapper is open-sourced software licensed under the MIT license.
- The Photon is open-sourced software licenced under GNU GENERAL PUBLIC LICENCE
Posted on Utopian.io - Rewarding Open Source Contributors
Leave PhotonBundle for Symfony to:
Read more #utopian-io posts
Best Posts From bencagri
We have not curated any of bencagri's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From bencagri
- Python Frameworks Comparison
- DNGO Assistant - Introducing Kali
- Book Cover Creator for DNGO
- Cem Karaca - Lets Go!
- Aurora - An Article Project with Symfony 4 and Domain Driven Design
- Trip Fairground - Turkish Psych Rock
- Is this a bug?
- SteemConnect provider for HybridAuth
- PhotonBundle for Symfony
- Php image acceleration and modification - Photon
- deprecated
- Did you ever need to use txt files as Database with Php?
- So, you did discover dmania.
- the last shoulder touch
- Free and extendable trading bot application for crypto currencies.
- Integration of Poloniex
- missing ticker/price endpoint