Quick Start

You are busy, and you just want to get things done™, so let’s get going.

After installation, you are ready to CRUD-ify your app.

App Controller

First, configure the Crud plugin.

Configuring the AppController

If you haven’t configured the CRUD plugin already, add the following lines to your src/Controller/AppController.php file

namespace App\Controller;

class AppController extends \Cake\Controller\Controller
    use \Crud\Controller\ControllerTrait;

    public function initialize()


        $this->loadComponent('Crud.Crud', [
            'actions' => [
            'listeners' => [
                // New listeners that need to be added:
                // If you need searching. Generally it's better to load these
                // only in the controller for which you need searching.

     * Before render callback.
     * @param \Cake\Event\Event $event The beforeRender event.
     * @return void
    public function beforeRender(\Cake\Event\Event $event)
        // For CakePHP 3.4+
        if ($this->viewBuilder()->getClassName() === null) {

        // For CakePHP 3.1+
        if ($this->viewBuilder()->className() === null) {

        // For CakePHP 3.0
        if ($this->viewClass === null) {
            $this->viewClass = 'CrudView\View\CrudView';

If you are familair with the CRUD plugin already, you will immediately understand that Crud view is simply a listener for the events generated by the plugin. If this is new to you, don’t worry, it will be explained in the following sections.

Using It In Your Controllers

Any controller inheriting from AppController will automatically implement the specified actions loaded int the CRUD component configuration. Therefore, you can just leave your controller code empty!

namespace App\Controller;

class CategoriesController extends AppController
    // No code here, but we have all actions available to use!

View the Results

You can now access your categories list by pointing your browser to http://example.com/categories. Browse around your new Admin interface for each of the controllers you have in your application.

  v: latest
On Read the Docs
Project Home
On GitHub

Free document hosting provided by Read the Docs.