starlit / app
一个轻量级的MVC风格微框架。
1.2.1
2022-10-19 11:48 UTC
Requires
- php: >=8.0
- filp/whoops: ^2.0
- monolog/monolog: ^1.0
- psr/container: ^1.0
- starlit/utils: ^1.1
- symfony/http-foundation: ^4.4.47
- symfony/routing: ^4.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- starlit/paginator: ^1.1.0
Suggests
- mustache/mustache: To render mustache templates with PHP
- starlit/paginator: Required for use of the pagination view helper
Provides
This package is auto-updated.
Last update: 2024-09-19 16:18:26 UTC
README
这是一个轻量级的MVC风格微框架,基本上只是将Symfony的HttpFoundation和Routing组件进行了连接。
安装
将包作为需求添加到您的 composer.json
$ composer require starlit/app
使用示例
<?php // In public index.php file $app = new BaseApp(); $request = Symfony\Component\HttpFoundation\Request::createFromGlobals(); $response = $app->handle($request); $response->send(); // IndexController.php class IndexController extends AbstractController { public function indexAction() { $this->view->headline = 'Hello, world!" } } // index.html.php ?> <h1><?=$this->getEscaped('headline')?></h1>
要求
- 需要PHP 5.6或更高版本。
许可
本软件许可协议为BSD 3-Clause License - 详细信息请参阅LICENSE
文件。