PHP code example of hq9000 / php-rest-router

1. Go to this page and download the library: Download hq9000/php-rest-router 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/ */

    

hq9000 / php-rest-router example snippets


/*
 * Here in test we use a simple subclass of a Node modeling some "Domain" class doing 
 * something actually useful. This one can hold some "tag", in reality,
 * it might, for instance, be able to handle a web request etc.
 */
class DomainNode extends Node
{

    /**
     * @var
     */
    private $tag;

    public function getTag()
    {
        return $this->tag;
    }

    public function setTag($tag)
    {
        $this->tag = $tag;
        return $this;
    }
}