PHPackages                             guss77/kohana-routing - 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. guss77/kohana-routing

ActiveKohana-module[Framework](/categories/framework)

guss77/kohana-routing
=====================

Kohana &gt;= 3.3 module for setting up routes through a configuration file

1.1.4(10y ago)01.0k1BSD-3-ClausePHPPHP &gt;=5.4

Since Sep 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/guss77/kohana-routing)[ Packagist](https://packagist.org/packages/guss77/kohana-routing)[ Docs](https://github.com/guss77/kohana-routing)[ RSS](/packages/guss77-kohana-routing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (7)Used By (0)

kohana-routing
==============

[](#kohana-routing)

Stop using bootstrap.php to set your Kohana routes - routing is just another configuration file now!

Installation
------------

[](#installation)

1. add `guss77/kohana-routing` to your `composer.json`, or run `composer require guss77/kohana-routing`
2. edit your `bootstrap.php` to add the `kohana-routing` module and remove the `Route::set()` call from the bottom of the file

The built-in configuration file includes a replacement for the default `Route::set()` code.

Usage
-----

[](#usage)

Instead of adding `Route::set()` calls in the `bootstrap.php` code, copy the `routes.php` config file from the module to your application, and add the rules there.

The configuration format is very simple - its an array of routing rules, where each element in the top level of the array represents a single `Route::set` call. For each rule:

- The rule "key" is the name of the route and corresponds to the first argument to `Route::set()`
- The rule "value" is an array with the following keys:
    - 'uri' - the rule expressions used to parse the URI, corresponds to the second argument to `Route::set()`
    - 'defaults' - optional array that defines the default values for the route expression values, corresponds to the `defaults()` call on the `Route` instance
    - 'rules' - optional array that contains regular expressions to limit the matching of the route expression to only parameters with valid values. This corresponds to the third argument to `Route::set()`

Example Configuration
---------------------

[](#example-configuration)

The following snippets demonstrates how to set up rules in the configuration file, but omit the config file boilerplate (the PHP decleration and return array syntax).

1. Default Koahan route

```
	'default' => [
		'uri' => '((/(/)))',
		'defaults' => [
			'controller' => 'welcome',
			'action'     => 'index',
		],
	],

```

1. Routes that load controllers from subdirectories

```
  'admins' => [
    'uri' => 'backoffice/(controller(/))',
    'defaults' => [
      'directory' => 'admin',
      'controller' => 'backoffice',
      'action' => 'menu',
    ],
  ],
  'clients' => [
    'uri' => '(/controller(/))',
    'defaults' => [
      'directory' => 'users',
      'controller' => 'welcome',
      'action' => 'index',
    ],
  ],

```

1. Route with argument validation

```
  'categories' => [
    'uri' => 'cat/',
    'rules' => [
      'category' => '[a-z\-_\.]+',
    ],
    'defaults' => [
      'controller' => 'categories',
      'action' => 'category',
    ],
  ],

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~41 days

Recently: every ~50 days

Total

6

Last Release

3701d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c78ae0c263489d27d6f6fb472b32f307ae2936d893d3e25f72af5ae1abb9e3a8?d=identicon)[guss77](/maintainers/guss77)

---

Top Contributors

[![guss77](https://avatars.githubusercontent.com/u/381782?v=4)](https://github.com/guss77 "guss77 (16 commits)")

---

Tags

configurationkohanarouting

### Embed Badge

![Health badge](/badges/guss77-kohana-routing/health.svg)

```
[![Health](https://phpackages.com/badges/guss77-kohana-routing/health.svg)](https://phpackages.com/packages/guss77-kohana-routing)
```

###  Alternatives

[kohana/database

The official Kohana module for database interactions, building queries, and prepared statements

158486.0k19](/packages/kohana-database)[kohana/image

The official Kohana module for manipulating images

103461.3k8](/packages/kohana-image)[kohana/auth

The official Kohana auth module

101227.2k9](/packages/kohana-auth)[kohana/cache

The official Kohana cache management module

76318.3k8](/packages/kohana-cache)[kohana/orm

The official Kohana ORM module

15772.1k8](/packages/kohana-orm)[kohana/minion

The official kohana module for running tasks via the CLI

114117.1k10](/packages/kohana-minion)

PHPackages © 2026

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