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()
    {
        // ...
    }

}

Комментариев нет: