PHP code example of aatis / routing

1. Go to this page and download the library: Download aatis/routing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aatis / routing example snippets


class AatisController extends AbstractController
{
    // ...
}

class AatisController extends AbstractController
{
    public function hello(): void
    {
        $this->render('template/path', [
            'template_var1' => 'Hello',
            'template_var2' => 'World !'
        ]);
    }
}

class AatisHomeController extends AbstractHomeController
{
    public function home(): void
    {
        // ...
    }
}

#[Route('/hello')]
public function hello(): void
{
    // ...
}

#[Route('/hello/{name}/{age}')]
public function hello(string $name, int $age): void
{
    // ...
}