jippi/cakephp-crud — pull request #42 by bravo-kernel (2013-07-28 16:31:18+00:00)
Title: Automatically mapResources() for all controllers

I think it would be nice if the Crud API provided a method to easily enable REST resource routes for all controllers in the application. This way the dev could make all /controller/view/123.json resources available as /controller/123.json with little to no effort.

Jippi suggested to make this dev-optional so I added this to my /app/Config/routes.php:

App::uses('ApiListener', 'Crud.Controller/Crud/Listener');

ApiListener::mapResources();
Router::setExtensions(array('json', 'xml'));
Router::parseExtensions();

Please note that:
- this is my first PR ever
- I am not sure this is even the right approach
- I honestly have no idea how to unit test this

So... please regard this as a HTH and feel free to provide me with any pointers to get this to pass.