Skip to content

Repository files navigation

Soli PHP Web

Soli Web Component.

安装

使用 composer 进行安装:

composer require soliphp/web

使用

如下我们编写 index.php 文件,内容为:

<?php// 默认控制器命名空间namespaceApp\Controllers;
include__DIR__ . "/vendor/autoload.php";
class IndexController extends \Soli\Controller
{
publicfunctionindex()
{
return'Hello, Soli.';
}
}
$app = new \Soli\Web\App();
// 处理请求,输出响应内容$app->handle()->send();
$app->terminate();
  1. 使用 php -S 启动 webserver
php -S localhost:8000
  1. 浏览器访问 http://localhost:8000/,即可看到如下信息:
Hello, Soli.

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages