PHPackages                             henriquebs0/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. henriquebs0/router

ActiveLibrary

henriquebs0/router
==================

113PHP

Since Jan 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/HenriqueBS0/router)[ Packagist](https://packagist.org/packages/henriquebs0/router)[ RSS](/packages/henriquebs0-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Router @HenriqueBS0
===================

[](#router-henriquebs0)

PHP component to control your application's routes.

Componente PHP para o controle de rotas de sua aplicação.

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

[](#installation)

Composer

```
composer require henriquebs0/router dev-main
```

Routes
------

[](#routes)

To start managing routes, just instantiate an object of the `Router(string $baseUri = '/')` class in a central point of your application where all requests pass (Ex: the file **index.php**), add the routes and at the end call the `resolve()` method.

### htaccess

[](#htaccess)

```
RewriteEngine On

# ROUTER URL Rewrite
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

```

### index.php

[](#indexphp)

```
