<?php
namespace App\Controller;
use App\Settings\SettingsManager;
use App\Template\TemplateResolver;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/**
* Index Controller
*
* @author Przemysław Chrupek <przemyslaw.chrupek@avt.pl>
* @package App\Controller
*/
class IndexController extends AbstractController
{
public function index(SettingsManager $settings, TemplateResolver $tmplResolver)
{
// TODO: Use cache
$title = (($s = $settings->getString('meta.index_title')))
? $s->getValue()
: 'Strona główna';
$siteTmpl = $tmplResolver->getDefaultSiteTemplate();
return $this->render("layouts/$siteTmpl/index.html.twig", [
'_title' => $title,
]);
}
}