crysalead/resource

Resource Routing & Dispatching Framework

dev-master 2023-06-13 17:33 UTC

This package is auto-updated.

Last update: 2024-11-13 20:17:10 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>