Skip to content

Instantly share code, notes, and snippets.

@Theaxiom
Created April 11, 2017 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Theaxiom/d467fb247d99a02f4ff3b1cd35c2d1ad to your computer and use it in GitHub Desktop.
Save Theaxiom/d467fb247d99a02f4ff3b1cd35c2d1ad to your computer and use it in GitHub Desktop.
Remapping new CRUD actions
<?php
namespace App\Controller\Api;
use Cake\Controller\Controller;
class ApiAppController extends Controller
{
use \Crud\Controller\ControllerTrait;
public $components = [
'RequestHandler',
'Crud.Crud' => [
'actions' => [
'Crud.Index',
'Crud.View',
'Crud.Add',
'Crud.Edit',
'Crud.Delete',
'Full' => 'Crud.View'
],
'listeners' => [
'Crud.Api',
'Crud.ApiPagination',
// 'Crud.ApiQueryLog'
]
]
];
public function initialize()
{
$this->loadComponent('RequestHandler');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment