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