✨ Cockpit integration
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Application\Controller;
|
||||
|
||||
use Application\Content\CockpitApi;
|
||||
@@ -8,7 +10,6 @@ use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
class ArticleController extends MainController
|
||||
{
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
* @throws GuzzleException
|
||||
@@ -17,15 +18,20 @@ class ArticleController extends MainController
|
||||
{
|
||||
$article = (new CockpitApi())->getArticle($this->getRouteParams('id'));
|
||||
|
||||
$this->getBreadcrumbs()->addBreadcrumb(
|
||||
$article->getTitle(),
|
||||
$article->getUrl()
|
||||
);
|
||||
|
||||
$this->pushToStash('article', [
|
||||
'subtitle' => $this->faker->sentence(2),
|
||||
'subtitle' => 'TODO: Subtitle',
|
||||
'title' => $article->getTitle(),
|
||||
'lead' => $this->faker->paragraph(),
|
||||
'lead' => $article->getExcerpt(),
|
||||
'text' => $article->getText(),
|
||||
'image' => [
|
||||
'src' => 'https://picsum.photos/seed/' . $this->faker->randomDigit() . '/1920/1080',
|
||||
'width' => 1920,
|
||||
'height' => 1080,
|
||||
'src' => $article->getImage()->getImageUrl(),
|
||||
'width' => $article->getImage()->getWidth(),
|
||||
'height' => $article->getImage()->getHeight(),
|
||||
'alt' => 'lorem ipsum',
|
||||
],
|
||||
]);
|
||||
|
Reference in New Issue
Block a user