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

ActiveLibrary[Framework](/categories/framework)

pedroquezado/router
===================

Um sistema de roteamento flexível e poderoso para PHP.

1.0.1(2y ago)111MITPHPPHP &gt;=7.2

Since Jun 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pedroquezado/router)[ Packagist](https://packagist.org/packages/pedroquezado/router)[ Docs](http://www.upinside.com.br)[ RSS](/packages/pedroquezado-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Router - PedroQuezado
=====================

[](#router---pedroquezado)

[![Maintainer](https://camo.githubusercontent.com/0a080976a7491620e4b9edfc914dd655ac5dd452570d344c0980aff4e8f99428/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d40706564726f7175657a61646f2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/pedroquezado)[![Source Code](https://camo.githubusercontent.com/b1165e15122567429d9cbe0f53977fb7d3d05ed45ce1e4f3e1b6a4ee688a29f5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d706564726f7175657a61646f2f726f757465722d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/pedroquezado/router)[![PHP from Packagist](https://camo.githubusercontent.com/2023d3f470386d47a5ca584e5df43172d345908690a05c9fe9c6b4f276dfafc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706564726f7175657a61646f2f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pedroquezado/router)[![Latest Version](https://camo.githubusercontent.com/cf4372dcc1c96fa1e1395fe7b95d896b16768022f6d9c18c14e881cc633f3019/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f706564726f7175657a61646f2f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/pedroquezado/router/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build](https://camo.githubusercontent.com/a76607348d9813e9f0563c0865c799d562e244ce02d89ea50fec77835bc4c8e2/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f706564726f7175657a61646f2f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pedroquezado/router)[![Quality Score](https://camo.githubusercontent.com/262977e3d5c89e45529b6ca1377d31f1452d2f71573a0ebfc124b8cd0fc31c0c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706564726f7175657a61646f2f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pedroquezado/router)[![Total Downloads](https://camo.githubusercontent.com/7b8988cf13a895abdff3fec7d96c227a853afda00ee9a2458d847d48ce837239/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706564726f7175657a61646f2f726f757465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pedroquezado/router)

About PedroQuezado
------------------

[](#about-pedroquezado)

PedroQuezado/Router is a PHP router component designed for routing requests in your application or API. It provides a simple and intuitive way to define routes and handle HTTP verbs (GET, POST, PUT, PATCH, DELETE) using the MVC pattern. The router works independently, ensuring isolation and seamless integration into your projects.

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

[](#installation)

You can install the PedroQuezado Router via Composer. Run the following command:

```
composer require pedroquezado/router
```

Router Class
------------

[](#router-class)

###### The Router class is the main entry point for routing requests. It provides methods to define routes, handle different HTTP verbs, and run the router to match and execute the appropriate route handlers.

[](#the-router-class-is-the-main-entry-point-for-routing-requests-it-provides-methods-to-define-routes-handle-different-http-verbs-and-run-the-router-to-match-and-execute-the-appropriate-route-handlers)

Usage
-----

[](#usage)

To use the Router class in your application, follow these steps:

- Create an **index.php** file in your project's root directory.
- Use Composer's autoloader to load the required files.
- Instantiate the **Router** class and define your routes.
- Dispatch the routes.

Here's an example of how to use the **Router** class:

```
