simkimsia / cakephp-backbone
Installs: 48
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 7
Open Issues: 1
Language:JavaScript
Type:cakephp-plugin
Requires
- composer/installers: ~1.0
This package is not auto-updated.
Last update: 2024-12-16 15:51:59 UTC
README
This is a very simple CakePHP plugin enabling you to add Backbone to your cake projects.
It does very little apart from supply you with the backbone base files, and offer you and a 'controller component' with a customized 'json'.
This will mate sure Cake controller set model properties will be output in the style Backbone is happy with.
Dependencies
In order to have the base files automatically loaded you need to install Mark Story's excellent 'Asset Compress' plugin
AssetCompress is available at github
Installation
In your bootstrap.php make sure you include the plugin
CakePlugin::load('CakephpBackbone');
Make sure you add set the correct files in your compress_asset.ini
[js]
paths[] = /cake/Backbone/
[backbone-base.js]
files[] = lib/jquery-min.js
files[] = lib/underscore-min.js
files[] = lib/backbone-min.js
You can then show that you are going to use the Backbone component and asset compress helper in your controllers.
var $helpers = array('AssetCompress.AssetCompress');
public $components = array (
'RequestHandler',
'CakephpBackbone.Backbone'
);
Then add the backbone files to your view.
<?php echo $this->AssetCompress->script('backbone-base'); ?>