marko/routing

Marko Framework Routing

Maintainers

Package info

github.com/marko-php/marko-routing

pkg:composer/marko/routing

Statistics

Installs: 7

Dependents: 14

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

This package is auto-updated.

Last update: 2026-03-25 21:07:37 UTC


README

Attribute-based routing with automatic conflict detection---define routes on controller methods, not in separate files.

Installation

composer require marko/routing

Quick Example

use Marko\Routing\Attributes\Get;
use Marko\Routing\Attributes\Post;
use Marko\Routing\Http\Response;

class ProductController
{
    #[Get('/products')]
    public function index(): Response
    {
        return new Response('Product list');
    }

    #[Get('/products/{id}')]
    public function show(int $id): Response
    {
        return new Response("Product $id");
    }

    #[Post('/products')]
    public function store(): Response
    {
        return new Response('Created', 201);
    }
}

Documentation

Full usage, API reference, and examples: marko/routing