mirror of
https://github.com/flarum/framework.git
synced 2025-02-09 00:03:59 +08:00
![Matt Kilgore](/assets/img/avatar_default.png)
Also ensure backwards compatibility for extensions that use the Zend framework but don't explicitly require it.
36 lines
794 B
PHP
36 lines
794 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Frontend;
|
|
|
|
use Laminas\Diactoros\Response\HtmlResponse;
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
use Psr\Http\Server\RequestHandlerInterface;
|
|
|
|
class Controller implements RequestHandlerInterface
|
|
{
|
|
/**
|
|
* @var Frontend
|
|
*/
|
|
protected $frontend;
|
|
|
|
public function __construct(Frontend $frontend)
|
|
{
|
|
$this->frontend = $frontend;
|
|
}
|
|
|
|
public function handle(Request $request): Response
|
|
{
|
|
return new HtmlResponse(
|
|
$this->frontend->document($request)->render()
|
|
);
|
|
}
|
|
}
|