Implemented homepage as source

This commit is contained in:
Kevin Frantz
2019-02-26 11:41:11 +01:00
parent 8c9ae85463
commit 3b8fcf5a71
3 changed files with 64 additions and 2 deletions

View File

@@ -4,6 +4,10 @@ namespace Infinito\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Infinito\Domain\FixtureManagement\FixtureSource\HomepageFixtureSource;
use Infinito\DBAL\Types\Meta\Right\LayerType;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Infinito\DBAL\Types\RESTResponseType;
/**
* This controller offers the standart routes for the template.
@@ -17,6 +21,16 @@ final class DefaultController extends AbstractController
*/
public function homepage(): Response
{
return $this->render('standard/homepage.html.twig');
// echo "Hello World!";
// $url = $this->generateUrl('infinito_api_rest_layer_read', [
// 'identity' => HomepageFixtureSource::SLUG,
// 'layer' => LayerType::SOURCE
// ]);
// return new RedirectResponse($url);
return $this->redirectToRoute('infinito_api_rest_layer_read', [
'identity' => HomepageFixtureSource::SLUG,
'layer' => LayerType::SOURCE,
'_format' => RESTResponseType::HTML,
]);
}
}