1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00
Files
php-flarum/src/Support/HtmlAction.php
Toby Zerner a74b40fe47 Massive refactor
- Use contextual namespaces within Flarum\Core
- Clean up and docblock everything
- Refactor Activity/Notification blueprint stuff
- Refactor Formatter stuff
- Refactor Search stuff
- Upgrade to JSON-API 1.0
- Removed “addedPosts” and “removedPosts” relationships from discussion
API. This was used for adding/removing event posts after renaming a
discussion etc. Instead we should make an additional request to get all
new posts

Todo:
- Fix Extenders and extensions
- Get rid of repository interfaces
- Fix other bugs I’ve inevitably introduced
2015-07-04 12:24:48 +09:30

30 lines
750 B
PHP

<?php namespace Flarum\Support;
use Psr\Http\Message\ServerRequestInterface as Request;
use Zend\Diactoros\Response;
abstract class HtmlAction extends Action
{
/**
* @param Request $request
* @param array $routeParams
* @return \Zend\Diactoros\Response
*/
public function handle(Request $request, array $routeParams = [])
{
$view = $this->render($request, $routeParams);
$response = new Response();
$response->getBody()->write($view->render());
return $response;
}
/**
* @param Request $request
* @param array $routeParams
* @return \Illuminate\Contracts\View\View
*/
abstract protected function render(Request $request, array $routeParams = []);
}