PHPackages                             kiss-php/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kiss-php/router

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kiss-php/router
===============

This is a KISS router and I try to keep it simple.

v1.0.2(1mo ago)019MITPHP

Since Oct 28Pushed 1mo agoCompare

[ Source](https://github.com/kiss-php/router)[ Packagist](https://packagist.org/packages/kiss-php/router)[ RSS](/packages/kiss-php-router/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (6)Used By (0)

HTTP ROUTER
===========

[](#http-router)

Requirements:

- PHP &gt;7.4
- Composer (vendor autoload)

To install you execute:

```
composer install ...
```

If you use Apache, create a `.htaccess` file next to your `index.php` file.

```
RewriteEngine On

# Never execute PHP files from public
RewriteRule ^public/.*\.php$ index.php [L,QSA,NC]

# Serve public non-PHP files directly
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f
RewriteRule ^(.+)$ public/$1 [L]

RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule ^ index.php [L,QSA]
```

With this setup, `public/home.png` is available as `/home.png`, but no `.php` file inside `public/` is served or executed directly.

If you use Nginx, add this inside your `server` block.

```
location = /index.php {
    # Your PHP/FPM config here
}

location ~ ^/public/.*\.php$ {
    rewrite ^ /index.php last;
}

location ~ \.php$ {
    rewrite ^ /index.php last;
}

location / {
    try_files /public$uri /index.php;
}
```

With this setup, `public/home.png` is available as `/home.png`, but no `.php` file inside `public/` is served or executed directly.

To start to use add the routes in your index.php file.

```
require 'vendor/autoload.php';

use Kiss\Http\Router;

Router::use('', 'Agrandesr\EasyRouter\Controllers\User'); //Function default main
Router::use('get','Agrandesr\EasyRouter\Controllers\User::get');
Router::use('update','Agrandesr\EasyRouter\Controllers\User::update');
```

If you want to serve files from a folder, use `useFolder`.

```
Router::useFolder('img', 'public/images/');
```

This serves `img/logo.png` from `public/images/logo.png`, and `img/128x128/logo.png` from `public/images/128x128/logo.png`.

When you use `php -S` for local development, you can serve `public/` from the URL root.

```
if (in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
    Router::useFolder('/', 'public/');
}
```

This serves `styles.css` from `public/styles.css`.

If you prefer to execute a PHP file directly, use `execute`.

```
Router::execute('about', '/pages/about.php');
```

If you want to create relative path you can use brackets.

```
Router::use('update/{id}','Agrandesr\EasyRouter\Controllers\User::update');
```

Next, you can use this relative path with the static function *getOption*.

```
$id = Router::getOption('id');
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~282 days

Total

3

Last Release

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61379065?v=4)[A.Grandes.R](/maintainers/AGrandesR)[@AGrandesR](https://github.com/AGrandesR)

---

Top Contributors

[![AGrandesR](https://avatars.githubusercontent.com/u/61379065?v=4)](https://github.com/AGrandesR "AGrandesR (19 commits)")

### Embed Badge

![Health badge](/badges/kiss-php-router/health.svg)

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

###  Alternatives

[nicmart/tree

A basic but flexible php tree data structure and a fluent tree builder implementation.

58821.2M21](/packages/nicmart-tree)[reefki/laravel-device-detector

Laravel wrapper for Matomo's Universal Device Detection library.

3175.7k](/packages/reefki-laravel-device-detector)[netspotau/moodle-mod_lightboxgallery

Lightbox gallery activity for Moodle

302.4k](/packages/netspotau-moodle-mod-lightboxgallery)

PHPackages © 2026

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