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 BlogOverviewAction extends AbstractAction
{
* Render blog ovierview
* {@inheritDoc}
* @see \Jolicht\MarkdownCms\Action\AbstractAction::__invoke()
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
$markdownCmsConfig = $this->getMarkdownCmsConfig();
$config = $markdownCmsConfig['content']['content_types']['blogEntry']['all'];
$entries = [];
$entryParser = $this->getEntryParser();
foreach ($config as $id) {
$entries[] = $entryParser($id);
}
return new HtmlResponse($this->getTemplateRenderer()->render('app::blog-overwiew.twig', ['entries' => $entries]));