PHP code example of quickclack / rest-attribute-bundle

1. Go to this page and download the library: Download quickclack/rest-attribute-bundle 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/ */

    

quickclack / rest-attribute-bundle example snippets


return [
    Quickclack\RestAttributeBundle\RestAttributeBundle::class => ['all' => true],
];

namespace App\Controller;

use Symfony\Component\HttpFoundation\JsonResponse;
use Quickclack\RestAttributeBundle\Attribute\RouteParam;
use Quickclack\RestAttributeBundle\Request\ParamFetcher;

class TestController
{
    #[Get('/api/test')]
    #[RouteParam(name: 'name', from: 'query', type: 'string')]
    #[RouteParam(name: 'age', from: 'query', type: 'int', default: 0, 
bash
composer install
php bin/phpunit