PHP code example of m6web / fos-rest-extra-bundle

1. Go to this page and download the library: Download m6web/fos-rest-extra-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/ */

    

m6web / fos-rest-extra-bundle example snippets


new FOS\RestBundle\FOSRestBundle(),
new M6Web\Bundle\FOSRestExtraBundle\M6WebFOSRestExtraBundle(),


use FOS\RestBundle\Controller\Annotations\QueryParam;
use M6Web\Bundle\FOSRestExtraBundle\Annotation\RestrictExtraParam;

/**
 * TestController
 */
class TestController
{
    /**
     * Restricted controller : only "param1" is permitted
     *
     * @return void
     *
     * @RestrictExtraParam(true)
     *
     * @QueryParam(name="param1", blic function getNonRestrictedAction() {

    }
}

yaml
fost_rest:
    param_fetcher_listener: true