PHP code example of kelvinwongg / yapi

1. Go to this page and download the library: Download kelvinwongg/yapi 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/ */

    

kelvinwongg / yapi example snippets



$yapi = new \Kelvinwongg\Yapi\Yapi('./api.yaml');



class Employees
{	
	public function get($file, $request, $response, $crudHook)
	{
		$response->setContent([
			[
				'id' => 1,
				'employee_name' => 'Steve Davis',
				'employee_title' => 'Staff'
			],
			[
				'id' => 2,
				'employee_name' => 'Ronnie Hart',
				'employee_title' => 'Admin'
			]
		]);
	}
}