{
$query = $this->em->createQuery("SELECT e FROM App:Event e WHERE e.highlight=true AND e.deleted!=true AND e.dateStart >= :date ORDER BY e.dateStart ASC")
->setParameters(['date' => new DateTime('now')]);
return ['events' => $query->getResult()];
}
#[ArrayShape(['event' => "\Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface", 'nextEvents' => "mixed"])] #[Route(path: '/{_locale}/koncert/{slug}', name: 'event_detail')]
public function detailAction(EventTranslation $eventTrans): Response
{
/** @var Event $event */
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
$response = null;
try {
return $response = $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
) {
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
if (Kernel::VERSION_ID >= 60400) {
$response->send(false);
if (\function_exists('fastcgi_finish_request') && !$this->debug) {
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
use App\Kernel;
// Set cache and log directories group-writable to avoid user permissions on server
umask(0002);
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool)$context['APP_DEBUG']);
};
ControllerDoesNotReturnResponseException
|
---|
Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned an array ([events => ...]). at src/Controller/EventController.php:279 at vendor/symfony/http-kernel/HttpKernel.php:181 at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:76) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:197) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/var/www/jazzdock.cz/vendor/autoload_runtime.php') (web/index.php:8) |