PHP code example of soliphp / web

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

    

soliphp / web example snippets




// 默认控制器命名空间
namespace App\Controllers;

tion index()
    {
        return 'Hello, Soli.';
    }
}

$app = new \Soli\Web\App();

// 处理请求,输出响应内容
$app->handle()->send();

$app->terminate();

php -S localhost:8000