crysalead/resource

Resource Routing & Dispatching Framework

dev-master 2019-06-22 08:41 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>