PHP code example of aichenk / tp6-server
1. Go to this page and download the library: Download aichenk/tp6-server 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/ */
aichenk / tp6-server example snippets
/** api/v1/Test.php **/
public function param($param1, $param2)
{
return $this->json([
'param1' => $param1,
'param2' => $param2
]);
}
// 访问 http://xxx/api/v1/test/param/aaa/bbb
// 输出:{"param1":"aaa","param2":"bbb"}