PHP code example of tmecareer / yii-fast-api
1. Go to this page and download the library: Download tmecareer/yii-fast-api 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/ */
tmecareer / yii-fast-api example snippets
// $config 为你原本的配置
$config = yii\helpers\ArrayHelper::merge(
$config,
\deepziyu\yii\rest\Controller::getConfig()
);
return $config;
class YourController extends deepziyu\yii\rest\Controller
{
/**
* 示例接口
* @param int $id 请求参数
* @return string version api版本
* @return int yourId 你的请求参数
*/
public function actionIndex($id)
{
return ['version'=>'1.0.0','yourId'=>$id];
}
}