GithubHelp home page GithubHelp logo

cloudinarybundle's Introduction

MisteioCloudinaryBundle

Latest Stable Version Latest Unstable Version License Build Status Coverage Status

MisteioCloudinaryBundle is a Symfony2 Bundle forked from laravel4-cloudinary (thanks Teeplus) and cloudinary-bundle (thanks Speicher210). You can use it as a service, and some extends are implemented for Twig. Cloudinary Library v1.0.11.

Install

Via Composer

$ composer require misteio/cloudinary-bundle

or in composer.json file

"misteio/cloudinary-bundle": "dev-master"

Register the bundle in app/AppKernel.php:

public function registerBundles()
{
    return array(
        // ...
        new Misteio\CloudinaryBundle\MisteioCloudinaryBundle(),
        // ...
    );
}

Configuration

Configure the connection to cloudinary in your config.yml :

misteio_cloudinary:
  cloud_name: yourCloudRegistrationName
  api_key: youtApiKey
  secret_key: yourSecretApiKey

Usage

This wrapper api provide simple methods to upload, rename, delete, tag manage and full features from original cloudinary class methods. You can use it via Dependency Injection Component(DIC) service.

	$cloudinary = $this -> container -> get('misteio_cloudinary_wrapper');

Upload

	$cloudinary -> upload('path/to/file', 'name', $tags)

Display an image

	$cloudinary -> show('public_name', array('width' => 150, 'height' => 150, 'crop' => 'fit', 'radius' => 20));

More document from cloudinary.com

Rename file

	$cloudinary -> rename('from_public_id', 'to_public_id');

Delete file

	$cloudinary -> destroy('public_id');

Manage with tag

	$cloudinary -> addTag('my_tag_1', array('my_public_id', 'my_public_id_2'));
    $cloudinary -> removeTag('my_tag_2', array('my_public_id', 'my_public_id_2'));
    $cloudinary -> replaceTag('my_tag_3', array('my_public_id', 'public_id_2'));

Twig for displaying image

	{{ 'my_public_id'|cloudinary_url({"width" : 150, "height" : 150, "crop" : "fill", "radius" : 20}) }}

Security

If you discover a security vulnerability , please email instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

License

This Wrapper is open-sourced software licensed under the MIT license

cloudinarybundle's People

Contributors

sergey-safonov avatar

Watchers

 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.