Category: php

how to enable allowDiskUse for Mongodb or how to use Aggregation builder?

| Bundle version | ^[email protected] | Symfony version | 5.0.5 | PHP version | 7.4.8 when followed for last page with sorting faced with error that’s what I used for paginatin public function getListQuery() { $builder = $this->createQueryBuilder(); return $builder->getQuery();…

How can I use checkboxType Field in Symfony formbuilder?

I am using checkboxType Field with Symfony formbuilder (https://symfony.com/doc/current/reference/forms/types/checkbox.html) $options = [ ‘attr’ => array(‘class’ => ‘checkbox’), ‘data’ => true, ‘mapped’ => false, ‘data_class’ => null, ‘required’ => true, ]; It works well, when the value is set to TRUE….

Symfony Key "name" for array with keys "0" does not exist. BUT IT EXISTS

Most emberassing for me: i just used the exact function yesterday, copied to a new project and suddenly broken. Here is the Function in my symfony to find database entrys by column type: /** * @Route("/type/{type}", name="sort_page", methods={"GET"}) */ public…

Symfony Exception Subscriber not triggered

I need to format error messages and output it in JSON format. I have the following event subscriber: namespace AppEventSubscriber; use SymfonyComponentEventDispatcherEventSubscriberInterface; use SymfonyComponentHttpKernelEventExceptionEvent; use SymfonyComponentHttpKernelKernelEvents; final class ExceptionSubscriber implements EventSubscriberInterface { public static function getSubscribedEvents(): array { return [KernelEvents::EXCEPTION…