13/04
2013
Advanced scaffolding which allows searching and exporting / importing of your models.. For CakePHP 2, (*1)
Add the repo to your working directory, (*2)
git submodule add https://github.com/morrislaptop/advindex app/Plugin/Advindex
Add the following to app/Config/bootstrap.php, (*3)
CakePlugin::load('Advindex');
Add the following to the top of AppController.php, (*4)
App::uses('Scaffold', 'Advindex.Controller'); App::uses('ScaffoldView', 'Advindex.View');
Include the following in your controller:, (*5)
public $helpers = array('Advindex.Advindex'); public $components = array('Advindex.Advindex'); public $scaffold = 'admin';
Finally, check you have your routing prefix enabled in app/Config/core.php, (*6)
Configure::write('Routing.prefixes', array('admin'));
See the bootstrap.php.example file to configure the scaffolding for each of your models, (*7)
function beforeFilter() { if ( !empty($this->params['admin']) ) { $this->layout = 'Advindex.default'; } }
For migration to CakePHP 2 - http://www.pronique.com/blog/how-to-create-your-own-scaffolding-plugin-for-cakephp2, (*8)