PHP code example of ppeerit / think-apicode
1. Go to this page and download the library: Download ppeerit/think-apicode 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/ */
ppeerit / think-apicode example snippets
return [
'type' => 'json',//输出格式
];
use Ppeerit\Apicode\Apicode;
// 参数为[错误信息,错误代码,数组形式的数据];
Apicode::error(['error message','9999', $data]);
// 参数为[成功信息,跳转地址,数组形式的数据];
Apicode::success(['success message',$url, $data]);