2017 © Pedro Peláez
 

cakephp-plugin cakephp-essence

A plugin to use the essence library in a CakePHP 2 project.

image

fg/cakephp-essence

A plugin to use the essence library in a CakePHP 2 project.

  • Saturday, March 8, 2014
  • by fg
  • Repository
  • 0 Watchers
  • 0 Stars
  • 30 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Essence for CakePHP

A plugin to use the essence library within controllers., (*1)

Installation

Just use composer from the app folder of your CakePHP installation:, (*2)

{
    "minimum-stability": "dev",
    "require": {
        "fg/cakephp-essence": "dev-master"
    },
    "config": {
        "vendor-dir": "Vendor"
    }
}

The plugin will be installed into Plugins/, thanks to composer's CakePHP installer, and the Essence library will be installed into Vendor/., (*3)

You should then load the plugin in Config/bootstrap.php:, (*4)

CakePlugin::load([
    'Essence' => [
        'bootstrap' => true
    ]
]);

Component

class MyController extends AppController {

    public $components = [ 'Essence.Essence' ];



    /**
     *  All methods of the Essence class are available through the Essence component.
     *  
     *  @see https://github.com/felixgirault/essence/blob/master/lib/fg/Essence/Essence.php
     */

    public function embed( $url ) {

        $this->set( 'media', $this->Essence->embed( $url ));
    }
}

Behavior

class MyModel extends AppModel {

    public $actsAs = [ 'Essence.Embeddable' ];

}

The Versions

08/03 2014

dev-master

9999999-dev http://github.com/felixgirault/cakephp-essence

A plugin to use the essence library in a CakePHP 2 project.

  Sources   Download

The Requires

 

media oembed opengraph embed