Files
kupshop/bundles/KupShop/ResponseCacheBundle/Controller/FragmentController.php
2025-08-02 16:30:27 +02:00

22 lines
576 B
PHP

<?php
namespace KupShop\ResponseCacheBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class FragmentController extends AbstractController
{
/**
* @Route("/_fragment/{type}/", requirements={"type"="[a-zA-Z0-9_-]+"})
*/
public function fragmentAction(string $type)
{
$smarty = createSmarty(false, true);
$response = new Response($smarty->fetch("fragments/{$type}.tpl"));
return $response;
}
}