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. [Framework](/categories/framework)
4. /
5. kaiserwerk/k-router

ActiveLibrary[Framework](/categories/framework)

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 2w 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

Maturity28

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://avatars.githubusercontent.com/u/12614975?v=4)[R. Kaiser](/maintainers/KaiserWerk)[@KaiserWerk](https://github.com/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)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M841](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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