PHPackages                             neuron-php/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. neuron-php/routing

ActiveLibrary[Framework](/categories/framework)

neuron-php/routing
==================

A lightweight router/dispatcher.

0.8.13(4mo ago)01.5k2MITPHPCI passing

Since Aug 16Pushed 4mo agoCompare

[ Source](https://github.com/Neuron-PHP/routing)[ Packagist](https://packagist.org/packages/neuron-php/routing)[ RSS](/packages/neuron-php-routing/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (4)Versions (45)Used By (2)

[![CI](https://github.com/neuron-php/routing/actions/workflows/ci.yml/badge.svg)](https://github.com/neuron-php/routing/actions)[![codecov](https://camo.githubusercontent.com/1f5bef049bb96c6443a7495a9652a35cea47bd9f42ebb6ac0045cc550c03d519/68747470733a2f2f636f6465636f762e696f2f67682f4e6575726f6e2d5048502f726f7574696e672f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Neuron-PHP/routing)

Neuron-PHP Routing
==================

[](#neuron-php-routing)

Overview
--------

[](#overview)

The neuron router is a lightweight router/dispatcher is the vein of Ruby's Sinatra or Python's Flask. It allows for a very quick method for creating an app using restful routes or to add them to an existing application.

- Easily map restful http requests to functions.
- Extract one or many variables from routes using masks.
- Create custom 404 responses.

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

[](#installation)

Install php composer from

Install the neuron routing component:

```
composer require neuron-php/routing

```

.htaccess
---------

[](#htaccess)

This example .htaccess file shows how to get and pass the route to the example application.

```
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]

```

Example App
-----------

[](#example-app)

Here is an example of a fully functional application that processes several routes including one with a variable.

```
