Automated admin backend based on your Crud configuration.
This project is in early stage of development, do not use it production unless you want to get down and dirty on the code :)
You can find the WIP detailed usage documentation here.
-
Install the plugin using
composer require --prefer-dist friendsofcake/crud-view:dev-master
. -
Add
Plugin::load('Crud');
,Plugin::load('CrudView');
&Plugin::load('BootstrapUI');
to yourapp/config/bootstrap.php
-
Configure Crud as per your needs.
-
Change
AppController::$viewClass
toCrudView\View\CrudView
-
Load the
CrudView.View
,Crud.RelatedModels
andCrud.Redirect
listeners. -
Hopefully going to
/<your controller with crud enabled/
should just work.
<?php
namespace App\Controller;
use Cake\Controller\Controller;
use Crud\Controller;
use Crud\Controller\ControllerTrait;
class AppController extends Controller
{
use ControllerTrait;
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->viewClass = 'CrudView\View\CrudView';
$this->loadComponent('Crud.Crud', [
'actions' => [
'Crud.Index',
'Crud.Add',
'Crud.Edit',
'Crud.View',
'Crud.Delete',
],
'listeners' => [
'CrudView.View',
'Crud.RelatedModels',
'Crud.Redirect',
],
]);
}
}