This guide explains how to upgrade your application when updating CalendarBundle to the version 8.1.
The bundle has been modernized to follow Symfony 8 best practices:
| Before | After |
|---|---|
src/CalendarBundle.php extends Bundle |
Extends AbstractBundle |
src/DependencyInjection/CalendarExtension.php |
Removed (merged into bundle) |
src/DependencyInjection/Configuration.php |
Removed |
src/Resources/config/services.yaml |
config/services.yaml |
src/Resources/config/routing.yaml |
config/routing.yaml |
src/Resources/views/ |
templates/ |
src/Resources/doc/ |
docs/ |
tests/DependencyInjection/CalendarExtensionTest.php |
tests/DependencyInjection/CalendarBundleTest.php |
Short service aliases have been added for convenience:
| Class Name | Alias |
|---|---|
CalendarBundle\Serializer\Serializer |
calendar.serializer |
CalendarBundle\Controller\CalendarController |
calendar.controller |
Both naming conventions are supported.
If you import the bundle's routing manually, update the path:
Before:
# config/routes/calendar.yaml
calendar:
resource: '@CalendarBundle/Resources/config/routing.yaml'After:
# config/routes/calendar.yaml
calendar:
resource: '@CalendarBundle/config/routing.yaml'If you override the bundle's templates in your application, no change is required. Symfony automatically resolves the correct location.
-
Update the bundle via Composer:
composer update tattali/calendar-bundle
-
Update routing import in
config/routes/calendar.yaml(if using manual import):calendar: resource: '@CalendarBundle/config/routing.yaml'
-
Clear cache:
php bin/console cache:clear
The following remain unchanged and fully backward compatible:
- Service IDs -
CalendarBundle\Serializer\Serializer,CalendarBundle\Controller\CalendarController, andCalendarBundle\Serializer\SerializerInterfacealias - Event subscriber pattern - Your
SetDataEventsubscribers work exactly the same - API endpoint -
/fc-load-eventsroute and behavior unchanged - Event entity -
CalendarBundle\Entity\Eventunchanged - Frontend integration - No JavaScript changes needed