PHP code example of mitsuki / attributes

1. Go to this page and download the library: Download mitsuki/attributes 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/ */

    

mitsuki / attributes example snippets


use Mitsuki\Attributes\Controller;

#[Controller(baseUri: '/api/v1')]
class UserController 
{
    // ...
}


use Mitsuki\Attributes\Route;

class UserController 
{
    #[Route(name: 'user_show', path: '/user/{id}', methods: ['GET'])]
    public function show(int $id) 
    {
        // Your logic here...
    }
}