<?php
namespace App\Controller;
use InvalidArgumentException;
use Pimcore\Controller\FrontendController;
use Pimcore\Model\DataObject;
use Symfony\Component\Routing\Annotation\Route;
class TorqServiceController extends FrontendController
{
/**
* @Route("/services/{torqServiceSlug}", name="torq_service_detail")
*/
public function detailAction(string $torqServiceSlug)
{
$torqService = DataObject\TorqService::getBySlug($torqServiceSlug, 1);
if(!$torqService){
throw new InvalidArgumentException('Service does not exist');
}
return $this->render('content/torqService.html.twig', [
'torqService' => $torqService
]);
}
}