kingzcheung/routing-match

v0.0.3 2021-06-28 02:39 UTC

This package is auto-updated.

Last update: 2025-03-28 11:08:23 UTC


README

composer require kingzcheung/routing-match

Usage

<?php

use KingzCheung\RoutingMatch\Routing;
$routes = [
            ["method"=>"POST","url"=>"/api/v2/resources"],
            ["method"=>"GET","url"=>"/api/v1/users/:id/roles"],
            ["method"=>"GET","url"=>"/api/v1/users/:id/comments"],
        ];
$n = Routing::create($routes)->matchNode("POST","/api/v1/users");

var_dump($n); // Node or null