title: How to customize the Data of FullCalenderBundle [Symfony4]
body: <p>I have added a select form above the calendar to select an user and show his events(entity booking for example)on the Fullcalendar</p>
  
  <p>so my question is, how the data of FullCalenderBundle change by the user selected in the form?</p>
  
  <p>this is some of files,</p>
  
  <p>FullCalenderListener.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\EventListener;
  
  use Doctrine\ORM\EntityManagerInterface;
  use Doctrine\ORM\Mapping\Entity;
  use App\Entity\Booking;
  use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  use Symfony\Component\Security\Core\Security;
  use Toiba\FullCalendarBundle\Entity\Event;
  use Toiba\FullCalendarBundle\Event\CalendarEvent;
  
  class FullCalendarListener
  {
      /**
       * @var EntityManagerInterface
       */
      private $em;
  
      /**
       * @var UrlGeneratorInterface
       */
      private $router;
  
      private $security;
  
      public function __construct(EntityManagerInterface $em, UrlGeneratorInterface $router,Security $security)
      {
          $this-&gt;em = $em;
          $this-&gt;router = $router;
          $this-&gt;security = $security;
      }
  
      public function loadEvents(CalendarEvent $calendar)
      {
          $startDate = $calendar-&gt;getStart();
          $endDate = $calendar-&gt;getEnd();
          $filters = $calendar-&gt;getFilters();
  
          // Modify the query to fit to your entity and needs
          // Change b.beginAt by your start date in your custom entity
          $user = $this-&gt;security-&gt;getUser();
  
          $bookings = $this-&gt;em-&gt;getRepository(Booking::class)
              -&gt;createQueryBuilder('b')
              -&gt;where('b.Responsable = :responsable')
              -&gt;setParameter('responsable', $user-&gt;getUsername())
              -&gt;andWhere('b.beginAt BETWEEN :startDate and :endDate')
              -&gt;setParameter('startDate', $startDate-&gt;format('Y-m-d H:i:s'))
              -&gt;setParameter('endDate', $endDate-&gt;format('Y-m-d H:i:s'))
              -&gt;getQuery()-&gt;getResult();
  
          foreach($bookings as $booking) {
  
              // this create the events with your own entity (here booking entity) to populate calendar
              $bookingEvent = new Event(
                  $booking-&gt;getTitle(),
                  $booking-&gt;getBeginAt(),
                  $booking-&gt;getEndAt() // If the end date is null or not defined, it creates a all day event
              );
  
              /*
               * Optional calendar event settings
               *
               * For more information see : Toiba\FullCalendarBundle\Entity\Event
               * and : https://fullcalendar.io/docs/event-object
               */
              // $bookingEvent-&gt;setUrl('http://www.google.com');
              // $bookingEvent-&gt;setBackgroundColor($booking-&gt;getColor());
              // $bookingEvent-&gt;setCustomField('borderColor', $booking-&gt;getColor());
  
              $bookingEvent-&gt;setUrl(
                  $this-&gt;router-&gt;generate('booking_show', array(
                      'id' =&gt; $booking-&gt;getId(),
                  ))
              );
  
              // finally, add the booking to the CalendarEvent for displaying on the calendar
              $calendar-&gt;addEvent($bookingEvent);
          }
      }
  }
  </code></pre>
  
  <p>calendar.html.twig</p>
  
  <pre><code>{% extends 'base.html.twig' %}
  
  
  {% block body %}
      &lt;div class="container"&gt;
          &lt;div class="p-3 mb-2 bg-primary text-white"&gt;Choose a user&lt;/div&gt;
          &lt;div class="p-3 mb-2"&gt;{{ form(form) }}&lt;/div&gt;
          &lt;div class="bg-light"&gt;
              &lt;a href="{{ path('booking_new') }}"&gt;Create new booking&lt;/a&gt;
              {% include '@FullCalendar/Calendar/calendar.html.twig' %}
          &lt;/div&gt;
      &lt;/div&gt;
  
  {% endblock %}
  
  {% block stylesheets %}
      {{ parent() }}
      &lt;link rel="stylesheet" href="{{ asset('bundles/fullcalendar/css/fullcalendar/fullcalendar.min.css') }}" /&gt;
  {% endblock %}
  
  {% block javascripts %}
      {{ parent() }}
      &lt;script type="text/javascript" src="{{ asset('bundles/fullcalendar/js/fullcalendar/lib/jquery.min.js') }}"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="{{ asset('bundles/fullcalendar/js/fullcalendar/lib/moment.min.js') }}"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="{{ asset('bundles/fullcalendar/js/fullcalendar/fullcalendar.min.js') }}"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="{{ asset('bundles/fullcalendar/js/fullcalendar/locale-all.js') }}"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
  
          $(function () {
  
              $('#calendar-holder').fullCalendar({
                  height: 'parent',
                  themeSystem: 'bootstrap4',
                  locale: 'fr',
                  header: {
                      left: 'prev, next, today',
                      center: 'title',
                      right: 'month, agendaWeek, agendaDay'
                  },
                  businessHours: {
                      start: '09:00',
                      end: '18:00',
                      dow: [1, 2, 3, 4, 5]
                  },
                  height: "auto",
                  contentHeight: "auto",
                  lazyFetching: true,
                  navLinks: true,
                  selectable: true,
                  editable: true,
                  eventDurationEditable: true,
                  eventSources: [
                      {
                          url: "{{ path('fullcalendar_load_events') }}",
                          type: 'POST',
                          data:  {
                              filters: {}
                          },
                          error: function () {
                              alert('There was an error while fetching FullCalendar!');
                          }
                      }
                  ]
              });
          });
      &lt;/script&gt;
  {% endblock %}
  </code></pre>
  
  <p>I have tried so much and i can't do it, thank you for your help </p>