PHPackages                             kaiserwerk/k-router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kaiserwerk/k-router

ActiveLibrary

kaiserwerk/k-router
===================

A little library which enables you to use @Route and @Method annotations in your vanilla PHP project.

579PHP

Since Dec 27Pushed 4y ago2 watchersCompare

[ Source](https://github.com/KaiserWerk/KRouter)[ Packagist](https://packagist.org/packages/kaiserwerk/k-router)[ RSS](/packages/kaiserwerk-k-router/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

KRouter
=======

[](#krouter)

### Installation &amp; Usage

[](#installation--usage)

First, do a `composer require kaiserwerk/k-router dev-master` to fetch the latest version. Then, In your index or bootstrap file, add

```
require_once __DIR__ . '/vendor/autoload.php';

...
// include your controller files here
...

$router = new KRouter();
$router->dispatch():

```

Then, you can create controller classes (don't forget to extend the Controller class and include the actual file) and add annotations like this:

```
class DefaultController extends Controller
{
    /**
     * @Route("/route/[:myvalue]/do", name="route_do")
     * @Method(["GET", "HEAD"])
     */
    public function routeDoAction($params)
    {
      $myvalue = $params->myvalue;
    }
}

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e0b84f5c8277b636e413d81635a2aa04d47536caf95ae9f38d31a30448dd13d?d=identicon)[KaiserWerk](/maintainers/KaiserWerk)

---

Tags

k-routerkrouterphprouterroutingvanilla-php

### Embed Badge

![Health badge](/badges/kaiserwerk-k-router/health.svg)

```
[![Health](https://phpackages.com/badges/kaiserwerk-k-router/health.svg)](https://phpackages.com/packages/kaiserwerk-k-router)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
