PHPackages                             jijihohococo/ichi-route - 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. jijihohococo/ichi-route

ActiveLibrary[Framework](/categories/framework)

jijihohococo/ichi-route
=======================

Router Library For PHP Projects

2(4mo ago)3841MITPHPPHP &gt;=7.0 || &gt;=8.0CI passing

Since Feb 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/jijihohococo/ichi-route)[ Packagist](https://packagist.org/packages/jijihohococo/ichi-route)[ RSS](/packages/jijihohococo-ichi-route/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (13)Used By (1)

ICHI PHP ROUTER
===============

[](#ichi-php-router)

ICHI PHP ROUTER is aimed to be the fast PHP Router with ease to use and protecting the security vulnerabilities

License
-------

[](#license)

This package is Open Source According to [MIT license](LICENSE.md)

Table Of Content
----------------

[](#table-of-content)

- [ICHI PHP ROUTER](#ichi-php-router)
    - [License](#license)
    - [Table Of Content](#table-of-content)
    - [Installation](#installation)
    - [Setting](#setting)
        - [Apache](#apache)
        - [Nginx](#nginx)
    - [Creating Controller](#creating-controller)
    - [Single Route](#single-route)
        - [PATCH Method](#patch-method)
        - [PUT Method](#put-method)
        - [DELETE Method](#delete-method)
    - [Using Routes](#using-routes)
    - [Route Parameter](#route-parameter)
    - [Resource Route](#resource-route)
    - [Prefix Route](#prefix-route)
    - [Subdomain Route](#subdomain-route)
        - [Single Subdomain](#single-subdomain)
        - [Subdomain Parameter](#subdomain-parameter)
    - [Dependency Injection](#dependency-injection)
    - [Middleware](#middleware)
    - [CSRF Token Authentication](#csrf-token-authentication)
    - [API Request Authentication](#api-request-authentication)
    - [CORS](#cors)
    - [Caching Route](#caching-route)
        - [Caching with Database](#caching-with-database)
        - [Caching with Redis](#caching-with-redis)
        - [Caching with Memcached](#caching-with-memcached)
    - [Error Page Customization](#error-page-customization)

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

[](#installation)

```
composer require jijihohococo/ichi-route
```

Setting
-------

[](#setting)

You must create following htaccess file before setting route according to your server.

### Apache

[](#apache)

Create .htaccess file in your based folder

```

RewriteEngine On

RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

```

### Nginx

[](#nginx)

Create .htacess file in your based folder

```

rewrite ^/(.*)/$ /$1 redirect;

if (!-e $request_filename){
	rewrite ^(.*)$ /index.php break;
}

```

Creating Controller
-------------------

[](#creating-controller)

You must create the controller for your routes.

Firstly you need to created the file named "ichi" under your project folder and use the below code in this file

```
#!/usr/bin/env php
