dev-master
9999999-dev http://github.com/felixgirault/cakephp-essenceA plugin to use the essence library in a CakePHP 2 project.
The Requires
media oembed opengraph embed
A plugin to use the essence library in a CakePHP 2 project.
A plugin to use the essence library within controllers., (*1)
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 ] ]);
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 )); } }
class MyModel extends AppModel { public $actsAs = [ 'Essence.Embeddable' ]; }
A plugin to use the essence library in a CakePHP 2 project.
media oembed opengraph embed