<?php
namespace App\Controller;
use Maris\CmsBundle\Repository\ModuleRepository;
use Maris\CmsBundle\Repository\PostMetaRepository;
use Maris\CmsBundle\Repository\PostRepository;
use Maris\CmsBundle\Service\FileService;
use PhpParser\Node\Expr\Array_;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HelperController extends AbstractController
{
private PostRepository $post;
private PostMetaRepository $postMeta;
private ModuleRepository $module;
private FileService $fileService;
private $mret = array();
private $mconf = array();
/**
* HelperController constructor.
* @param PostRepository $post
* @param PostMetaRepository $postMeta
* @param ModuleRepository $module
* @param FileService $fileService
*/
public function __construct(PostRepository $post, PostMetaRepository $postMeta, ModuleRepository $module, FileService $fileService)
{
$this->post = $post;
$this->postMeta = $postMeta;
$this->module = $module;
$this->fileService = $fileService;
$trescModule = $this -> module ->find(['id' => '2']);
$this -> mret = $this -> post -> findBy(['module' => $trescModule, 'status' => 'A'],['position' => 'DESC']);
}
#[Route('/site-menu/{module}', name: 'site_menu')]
public function getMenu(): Response
{
return $this->render('partial/navbarTop.html.twig', [
'siteURL' => $_ENV['SITE_URL'],
'menu' => $this -> mret
]);
}
}