Skip to content

marriosdev/MareaTurboRouter2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marea Turbo Router

PHP Version 8.1^

VRUMMMMMMMMMMMMMMMM

Total Downloads Latest Stable Version License

@marriosdev


Starting

composer require marrios/mareaturborouter

Copy

<?php

require_once("vendor/autoload.php");

use MareaTurbo\Router;

use MareaTurbo\Route;

class ControllerTeste
{
    public function __construct()
    {}

    #[Route("/teste/{id}", "GET", "route.name")]
    public function teste($request)
    {
        // get all parameters
        $request->all();

        // get only id parameter
        echo $request->only(["id"])['id'];
    }
}

// Register  controllers
(new Router())->controllers([
    ControllerTeste::class
]);

In your browser, access the URL: http://localhost/teste/123
And you will see the result: 123


You can run this route in CLI mode

php .\index.php GET /teste/123
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy