https://github.com/speicher210/cloudinarybundle
Symfony bundle for Cloudinary PHP API library
https://github.com/speicher210/cloudinarybundle
cloudinary php symfony-bundle
Last synced: 5 months ago
JSON representation
Symfony bundle for Cloudinary PHP API library
- Host: GitHub
- URL: https://github.com/speicher210/cloudinarybundle
- Owner: Speicher210
- License: mit
- Created: 2015-07-03T13:39:38.000Z (over 10 years ago)
- Default Branch: 1.x
- Last Pushed: 2025-02-07T09:53:31.000Z (11 months ago)
- Last Synced: 2025-03-30T01:11:17.742Z (9 months ago)
- Topics: cloudinary, php, symfony-bundle
- Language: PHP
- Homepage:
- Size: 82 KB
- Stars: 23
- Watchers: 5
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Speicher210 CloudinaryBundle
[](https://github.com/Speicher210/CloudinaryBundle/releases)
[](LICENSE.md)

## Install
Add [`speicher210/cloudinary-bundle`](https://packagist.org/packages/speicher210/CloudinaryBundle) to your `composer.json` file:
``` bash
composer require "speicher210/cloudinary-bundle"
```
Register the bundle:
``` php
['all' => true],
// ...
];
```
or
``` php
// app/AppKernel.php
// ...
public function registerBundles()
{
return array(
// ...
new Speicher210\CloudinaryBundle\Speicher210CloudinaryBundle(),
// ...
);
}
// ...
```
## Usage
Configure the connection to cloudinary in your `config.yml` :
``` yaml
speicher210_cloudinary:
url: cloudinary://my-key:my-secret@my-cloud
# The next configuration variables should be defined if they are not present in the URL
# The URL will take precedence
cloud_name: my-cloud
access_identifier:
api_key: my-key
api_secret: my-secret
options:
secure: true
```
The following services will be available:
``` php
$this->get('speicher210_cloudinary.cloudinary'); // Extension of Cloudinary from cloudinary package.
$this->get('speicher210_cloudinary.api'); // Extension of Cloudinary\Api from cloudinary package.
$this->get('speicher210_cloudinary.uploader'); // Extension of Cloudinary\Uploader from cloudinary package.
```
You can pass the same options to the twig filter or function:
``` twig
{{ cloudinary-public-id | cloudinary_url({'width': 50, 'height': 50, 'crop': 'fill'}) }}
{{ cloudinary_url('cloudinary-public-id', {'width': 50, 'height': 50, 'crop': 'fill'}) }}
{{ cloudinary_image_tag('cloudinary-public-id', {'height' : 150}) }}
{{ cloudinary_video_tag('cloudinary-public-id', {'height' : 150}) }}
```
For further documentation see [Cloudinary PHP library](https://github.com/cloudinary/cloudinary_php)
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email instead of using the issue tracker.
## Credits
- [Dragos Protung](https://github.com/dragosprotung)
- [All contributors][link-contributors]
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
[link-contributors]: ../../contributors