PHP code example of fijas / rest-api-doc
1. Go to this page and download the library: Download fijas/rest-api-doc 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/ */
fijas / rest-api-doc example snippets
namespace app\controllers;
class ExampleController extends \yii\rest\ActiveController
{
/**
* Rest Description: Your endpoint description.
* Rest Fields: ['field1', 'field2'].
* Rest Filters: ['filter1', 'filter2'].
* Rest Expand: ['expandRelation1', 'expandRelation2'].
*/
public function actionTest()
{
return ['field1', 'field2'];
}
}