ruta

A lightweight HTTP routing library for PHP 8+ without external dependencies. (WIP)

APACHE-2.0 License

Downloads
44
Stars
4
Committers
1
ruta - v1.0.0-beta.6 Latest Release

Published by joseluisq almost 2 years ago

Fixes

  • 1c617d4 Superfluous php-doc tags on Request class.

Features

  • 2043499 Initial Before routing middleware support.
    <?php
    // Middleware example that should be defined at the beginning
    Ruta::before(function (Request $req, Response $resp) {});
    

Refactorings

  • c6c949a Preserve Response class data state.
  • e6d19e9 Simplify and improve Ruta classes logic. PR #1
  • 78a6f95 Remove composer autoload files.
  • 82109fd Update development dependencies.
ruta - v1.0.0-beta.5

Published by joseluisq over 2 years ago

Fixes

  • e19d988 Wrong left route placeholder offset (E.g {abc}) when parsing.
  • d49191f Too few arguments for an specific route callback.

Features

  • 074e3e0a Additional array $data param for every route callback function.
    <?php
    // NOTE: the array (right side) will be passed to the `$data` param in the callback if defined.
    Ruta::get('/abc', function (Request $req, array $data) {}, ['some' => 'data']);
    
  • c8e19e6 Additional data also passed to an existing route_data property if Ruta class is extended.
  • c21928c Named route callback params (array $args, array $data).
    <?php
    // NOTE: all arguments are optional and order-insensitive.
    Ruta::get('/todo/{id}', function (Request $req, Response $resp, array $args, array $data) {});
    
ruta - v1.0.0-beta.4

Published by joseluisq over 2 years ago

Fixes

  • 3b98df5 Fix wrong path matching.
ruta - v1.0.0-beta.3

Published by joseluisq over 2 years ago

Refactorings

  • 01788f1 Make all classes extensible.
ruta - v1.0.0-beta.2

Published by joseluisq over 2 years ago

Features

  • bf7112a Regular expressions support. E.g /abc/regex(id=^[0-9]+$)/def
ruta - v1.0.0-beta.1

Published by joseluisq almost 3 years ago

First beta release

Package Rankings
Top 26.01% on Packagist.org
Badges
Extracted from project README
tests ci