PHP code example of liluoao / api-doc

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

    

liluoao / api-doc example snippets


$apiDoc = new \Liluoao\ApiDoc('your-file-folder');

$apiDoc->setName('doc-name');
$apiDoc->setCamel2SnakeConfig(false, false, 0, 0);

$apiDoc->init();

/**
 * 组合一句问候
 * api GET /index/hello
 * @param string $name 你想问候的人
 * @param string $say 问候语
 * @return string 组合后的话
 */
public function hello(string $name, string $say): string {
    return "Hello,{$name},{$say}";
}