crysalead/resource

Resource Routing & Dispatching Framework

dev-master 2021-08-18 13:50 UTC

This package is auto-updated.

Last update: 2021-09-18 14:00:28 UTC


README

Build Status Code Coverage

Resource dispatching strategy for router.

Installation

composer require crysalead/resource

API

Setting up the strategy

Example of routes definition:

use Lead\Router\Router;
use Lead\Router\Resource\ResourceStrategy;

$router = new Router();

$router->strategy('resource', new ResourceStrategy());


$router->resource('MyResource');

// Matching any following URLs
// /my_resource
// /my_resource/:<action>
// /my_resource/<id>/:<action>
// /my_relation/<id>/my_resource
// /my_relation/<id>/my_resource/:<action>