fg/cakephp-essence

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

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

dev-master 2014-03-08 13:08 UTC

This package is auto-updated.

Last update: 2022-02-01 12:25:33 UTC


README

A plugin to use the essence library within controllers.

Installation

Just use composer from the app folder of your CakePHP installation:

{
	"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/.

You should then load the plugin in Config/bootstrap.php:

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' ];
	
}