PHPackages                             brdev/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. [Framework](/categories/framework)
4. /
5. brdev/router

ActiveLibrary[Framework](/categories/framework)

brdev/router
============

Class fast and extremely uncomplicated. Create routes simplified

1.9(2y ago)2471MITPHPPHP ^7.0|^8.0

Since Apr 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/brendooliveira/BRdev-router)[ Packagist](https://packagist.org/packages/brdev/router)[ Docs](https://criativodahora.com.br)[ RSS](/packages/brdev-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (11)Used By (1)

###### Small, simple and uncomplicated. The router is a PHP route components with abstraction for MVC. Prepared with RESTfull verbs (GET, POST, PUT, PATCH and DELETE), works on its own layer in isolation and can be integrated without secrets to your application.

[](#small-simple-and-uncomplicated-the-router-is-a-php-route-components-with-abstraction-for-mvc-prepared-with-restfull-verbs-get-post-put-patch-and-delete-works-on-its-own-layer-in-isolation-and-can-be-integrated-without-secrets-to-your-application)

Pequeno, simples e descomplicado. O router é um componentes de rotas PHP com abstração para MVC. Preparado com verbos RESTfull (GET, POST, PUT, PATCH e DELETE), trabalha em sua própria camada de forma isolada e pode ser integrado sem segredos a sua aplicação.

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

[](#installation)

Router is available via Composer:

```
"brdev/router": "1.8"
```

or run

```
composer require brdev/router
```

Documentation
-------------

[](#documentation)

###### For details on how to use the router, see the sample folder with details in the component directory. To use the router you need to redirect your route routing navigation (index.php) where all traffic must be handled. The example below shows how:

[](#for-details-on-how-to-use-the-router-see-the-sample-folder-with-details-in-the-component-directory-to-use-the-router-you-need-to-redirect-your-route-routing-navigation-indexphp-where-all-traffic-must-be-handled-the-example-below-shows-how)

Para mais detalhes sobre como usar o router, veja a pasta de exemplo com detalhes no diretório do componente. Para usar o router é preciso redirecionar sua navegação para o arquivo raiz de rotas (index.php) onde todo o tráfego deve ser tratado. O exemplo abaixo mostra como:

#### Apache

[](#apache)

```
RewriteEngine On
Options All -Indexes

# ROUTER HTTPS Redirect
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

```

#### Nginx

[](#nginx)

```
location / {
     try_files $uri $uri/ /index.php?route=$uri&$args;
}

```

##### Routes

[](#routes)

```
