for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Lichtenwallner (https://lichtenwallner.at)
*
* @see https://github.com/jolicht/markdown-cms for the canonical source repository
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
* @copyright Copyright (c) Johannes Lichtenwallner
*/
declare(strict_types = 1);
namespace Jolicht\MarkdownCms\Action;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Response\HtmlResponse;
class SingleBlogEntryAction extends AbstractAction
{
* Get single blog entry
* {@inheritDoc}
* @see \Jolicht\MarkdownCms\Action\AbstractAction::__invoke()
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
$entry = ($this->getEntryParser())($request->getAttribute('id'));
return new HtmlResponse($this->getTemplateRenderer()->render($entry->getTemplate(), ['entry' => $entry]));
}