Deprecated : Constant E_STRICT is deprecated in /var/www/html/k/kasscaffolding/vendor/symfony/error-handler/ErrorHandler.php on line 58
Deprecated : Constant E_STRICT is deprecated in /var/www/html/k/kasscaffolding/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler
<?php
namespace App\Controller ;
use App\Entity\Sectors ;
use App\Annotation\CmsComponent ;
use Doctrine\ORM\EntityManagerInterface ;
use Symfony\Component\HttpFoundation\Request ;
use Symfony\Component\HttpFoundation\Response ;
use Symfony\Component\Routing\Annotation\Route ;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController ;
class SectorsDefaultController extends AbstractController
{
public function __construct (private EntityManagerInterface $em )
{
}
/**
* @CmsComponent("Sector Slider", active=true, routeName="embed_sectors_slider")
*/
#[ Route ( '/tlb-sectors/slider' , name : 'embed_sectors_slider' )]
public function slider (): Response
{
$sectors = $this -> em -> getRepository ( Sectors ::class)-> findBy ([ 'active' => 1 , 'deleted' => 0 ], [ 'sortOrder' => 'ASC' ]);
return $this -> render ( '@theme/sectors/slider.html.twig' , [
'sectors' => $sectors
]);
}
/**
* @CmsComponent("Sector List", active=true, routeName="embed_sectors_list")
*/
#[ Route ( '/tlb-sectors/list' , name : 'embed_sectors_list' )]
public function list(): Response
{
$sectors = $this -> em -> getRepository ( Sectors ::class)-> findBy ([ 'active' => 1 , 'deleted' => 0 ], [ 'sortOrder' => 'ASC' ]);
return $this -> render ( '@theme/sectors/list.html.twig' , [
'sectors' => $sectors
]);
}
/**
* @CmsComponent("Sector List Full", active=true, routeName="embed_sectors_list_full")
*/
#[ Route ( '/tlb-sectors/list-full' , name : 'embed_sectors_list_full' )]
public function list2 (): Response
{
$sectors = $this -> em -> getRepository ( Sectors ::class)-> findBy ([ 'active' => 1 , 'deleted' => 0 ], [ 'sortOrder' => 'ASC' ]);
return $this -> render ( '@theme/sectors/list_full.html.twig' , [
'sectorChunks' => array_chunk ( $sectors , 3 )
]);
}
/**
* @CmsComponent("Single Sector", slug="{sector_slug}", slugEntity="Sectors", active=true, routeName="embed_sector_content")
*/
#[ Route ( '/tlb-sectors/content/{sector_slug}' , name : 'embed_sector_content' )]
public function embedSectorContent ( mixed $sector_slug ): Response
{
$sector = $this -> em -> getRepository ( Sectors ::class)-> findBySlugWithGallery ( $sector_slug );
if (!$sector ) {
return new Response ( 'Not Found' );
}
return $this -> render ( '@theme/sectors/article.html.twig' , [
'sector' => $sector
]);
}
}