April 4, 2019

cakephp 3 multiple levels deep prefix

Router::prefix('api', function ($routes) {
    $routes->prefix('users', function ($routes) {
        $routes->fallbacks(DashedRoute::class);
    });
});

namespace App\Controller\Api\Users;

use App\Controller\AppController;
use Cake\Event\Event;
use Cake\ORM\TableRegistry;

class UsersController extends AppController
{

    public function index()
    {
        // ...
    }

}

No comments: