PHP code example of telabotanica / tb-base-rest-service

1. Go to this page and download the library: Download telabotanica/tb-base-rest-service 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/ */

    

telabotanica / tb-base-rest-service example snippets


class MyService extends BaseRestServiceTB {
	public function __construct() {
		$config = array(
			"domain_root" => "http://sub.mydomain.tld",
			"base_uri" => "/my-service-root-folder",
			"first_resource_separator" => "/"
		);
		parent::__construct($config);
	}

	protected function get() {
		// ...
	}

	protected function post() {
		// ...
	}
}