i want to implement in my Sylius project the BitBag Elasticsearch - but Site-Wide.
But i don't know how to get the form in my homepage controller. Is there any help for me?
My homepage controller so far:
<?php
declare(strict_types=1);
namespace App\Controller\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\HttpFoundation\Response;
final class HomepageController extends AbstractController
{
/** @var EngineInterface */
private $templatingEngine;
public function __construct(EngineInterface $templatingEngine)
{
$this->templatingEngine = $templatingEngine;
}
public function indexAction(): Response
{
$em = $this->getDoctrine()->getManager();
$games = $em->getRepository('App\Entity\Extras\Games')->findNextOnesLimited(10);
$medals = $em->getRepository('App\Entity\Extras\Medalsuccess')->find(1);
return $this->templatingEngine->renderResponse(
'@SyliusShop/Homepage/index.html.twig', [
'games' => $games,
'medals' => $medals
]
);
}
}