komarserjio / crud-view

(Incubator project) Automated admin backend based on your Crud configuration

Home Page:http://friendsofcake.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crud View

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 :)

Documentation

You can find the WIP detailed usage documentation here.

Quick Start

  1. Install the plugin using composer require --prefer-dist friendsofcake/crud-view:dev-master.

  2. Add Plugin::load('Crud');, Plugin::load('CrudView'); & Plugin::load('BootstrapUI'); to your app/config/bootstrap.php

  3. Configure Crud as per your needs.

  4. Change AppController::$viewClass to CrudView\View\CrudView

  5. Load the CrudView.View, Crud.RelatedModels and Crud.Redirect listeners.

  6. Hopefully going to /<your controller with crud enabled/ should just work.

Example controller

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

About

(Incubator project) Automated admin backend based on your Crud configuration

http://friendsofcake.com/

License:MIT License


Languages

Language:PHP 94.7%Language:JavaScript 3.6%Language:CSS 1.6%