1. Go to this page and download the library: Download willsprod/ux-fullcalendar library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
#[Route('/api/events', name: 'api_events')]
public function getEvents(): JsonResponse
{
return $this->json([
[
'id' => 1,
'title' => 'Meeting',
'start' => '2025-08-12T10:00:00',
'end' => '2025-08-12T11:00:00',
],
// ... other events
]);
}
// Default plugins : dayGrid, timeGrid, interaction
$calendar = $builder->createCalendar("advanced");
// Add plugins
$calendar->addPlugin('list');
$calendar->addPlugin('rrule');
// Or défine completely
$calendar->setEnabledPlugins(['dayGrid', 'timeGrid', 'list']);
// Check if a plugin is active
if ($calendar->hasPlugin('interaction')) {
// Your specific configuration
}
#[Route('/event/drop', name: 'app_event_drop', methods: ['POST'])]
public function eventDrop(Request $request): JsonResponse
{
$data = json_decode($request->getContent(), true);
// Process the event move
// $data['eventId'], $data['newStart'], $data['newEnd']
return $this->json([
'success' => true,
'message' => 'Event successfully moved'
]);
}
#[Route('/event/resize', name: 'app_event_resize', methods: ['POST'])]
public function eventResize(Request $request): JsonResponse
{
$data = json_decode($request->getContent(), true);
// Process resizing
// $data['eventId'], $data['newStart'], $data['newEnd']
return $this->json([
'success' => true,
'message' => 'Event successfully resized'
]);
}