PHP code example of richardgoldstein / fat-free-routes

1. Go to this page and download the library: Download richardgoldstein/fat-free-routes 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/ */

    

richardgoldstein / fat-free-routes example snippets



class MyFatFreeController {

   /**
    * @route GET @alias: /path/here
    *
    * @param \Base $f3
    * @param array $args
    */
   public function someHandler(\Base $f3, $args) {
      //...
   }

}
 

$f3->route('GET @alias: /path/here', 'MyFatFreeController->someHandler');

function installRoutes($

/**
 *
 * @routeMap @mapAlias: /company/@id [js]
 *
 */
class Company {
    // ...
}

$f3->map('/company/@id', 'Company');

   /**
    *
    * @route GET /mypath
    * @f3routes-route GET /mypath
    * @f3routes\route GET /mypath
    * @\f3routes\route GET /mypath
    */
    public function myHandler(....) {
        // ...