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

ActiveLibrary[Framework](/categories/framework)

saaiph/router
=============

Core the Route

1.0(6y ago)0232MITPHPPHP &gt;=7.1

Since May 17Pushed 6y agoCompare

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

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

[![](https://user-images.githubusercontent.com/33224319/57905337-95f1a500-784c-11e9-83c2-34c96465f5fd.jpg)](https://user-images.githubusercontent.com/33224319/57905337-95f1a500-784c-11e9-83c2-34c96465f5fd.jpg)

 [ ![](https://camo.githubusercontent.com/b9791c35e30a88f26c1bd269393ddb09e69672d1b8ce4e81d6b07fb7c30d00aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c656173652d76312e302d677265656e2e737667) ](https://github.com/saaiph/saaiph/releases) [ ![](https://camo.githubusercontent.com/b25c1531aafbc7aef38bedd32f480f2b8b7945fdd0c59843af48a9e4504e234f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e312e322d707572706c652e737667) ](http://php.net) [ ![](https://camo.githubusercontent.com/33b959372ddaaeae443ed09490219c9ac31dfbaa302d5413f22f7adf3837ef21/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275696c642d537563636573732d477265656e2e737667) ](https://github.com/saaiph/saaiph/releases) [ ![](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667) ](https://lbesson.mit-license.org/)

Router
======

[](#router)

> Saaiph\\Router é uma simples biblioteca para manipulação de rotas com funções e usando também, controllers e action.

Iniciado com Router
-------------------

[](#iniciado-com-router)

> 1. Necessário tem composer instalado.
> 2. Clone do project

```
//Clone do projeto
$ git clone https://github.com/saaiph/dotenv.git router

//Acessando a pasta do projeto.
$ cd router

//Gerando o autoload do project em PSR-4 com composer.
$ composer install

```

### Instânciando a classe Router

[](#instânciando-a-classe-router)

```
    use \Saaiph\Router\Router;

    //$filename é o local onde vai ficar armazenado os verbos usados no http padrão, GET, POST, PUT e Delete;
    //$namespaceController argumentos opcional, se for usar controllers no seus projeto é necessário colocar o namespace inicial onde ficarar armazenado o seus controllers;
    $router = new Router($filename, true or false, $namespace_controller);

    //Exemplo de uso
    $router = new Router(__DIR__."/router/web.php", true, "\Controllers\\");
```

### Estrutura do arquivo web.php (ou outros)

[](#estrutura-do-arquivo-webphp-ou-outros)

> É necessário criar um arquivo onde irá armazenar os verbos da rotas que você irá criar;

1. Criando uma pastar na raiz do projeto: Ex: router;
2. Criando o arquivo onde irar armazenar os verbos: Ex: web.php;

> verbos que podem disponíveis

```
//Instanciando o verbos
    Use \Saaiph\Router\Router;

    //Verbos
    Router::get($url, $struct);
    Router::post($url, $struct);
    Router::put($url, $struct);
    Router::delete($url, $struct);

    //Verbos utilizando function
    Router::get("/home", function () {
        #Código
    });
    Router::post("/home", function () {
        #Código
    });
    Router::put("/home", function () {
        #Código
    });
    Router::delete("/home", function () {
        #Código
    });

    //Verbos utilizando Controllers;
    Router::get("/home", "Controller@action");
    Router::post("/home", "Controller@action");
    Router::put("/home", "Controller@action");
    Router::delete("/home", "Controller@action");
```

Baseado na Lincensa MIT
-----------------------

[](#baseado-na-lincensa-mit)

> leia o arquivo LINCESE para mais informações.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2549d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2c5cb9d6271d7ca50d6a636a505c4ff54777f847525fecf4150008dc3254e93?d=identicon)[danieljuniorce](/maintainers/danieljuniorce)

---

Top Contributors

[![danieljuniorce](https://avatars.githubusercontent.com/u/33224319?v=4)](https://github.com/danieljuniorce "danieljuniorce (4 commits)")

### Embed Badge

![Health badge](/badges/saaiph-router/health.svg)

```
[![Health](https://phpackages.com/badges/saaiph-router/health.svg)](https://phpackages.com/packages/saaiph-router)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
