labrin/calendar-bundle
Composer 安装命令:
composer require labrin/calendar-bundle
包简介
Symfony bundle integrating FullCalendar.js for managing events, tasks, and appointments with drag-and-drop and CRUD support.
README 文档
README
A Symfony bundle that provides a full-featured calendar interface and event management system.
Installation
- Install the bundle via Composer :
composer require labrin/calendar-bundle:dev-main
- Register the routes
Add the following to your main Symfony application's config/routes.yaml to load the bundle routes under /calendar
calendar:
resource: '@LabrinCalendarBundle/Resources/config/routes.yaml'
prefix: /calendar
- Run Doctrine Migrations
Create and apply migrations for the Event entity used by the bundle:
php bin/console make:migration
php bin/console doctrine:migrations:migrate
Usage
- Inject and call the CalendarService in your controller
Use the bundle?s calendar service to fetch event data for a specific user:
// In your controller
$data = $this->calendarService->getCalendarDataForUser($user);
return $this->render('test/index.html.twig', [
'events' => $data['events'],
'draggableEvents' => $data['draggableEvents'],
'user' => $user,
]);
- Include the calendar Twig template in your view
Embed the calendar UI by including the bundle's Twig template:
{# test/index.html.twig #}
{% include '@LabrinCalendar/calendar/index.html.twig' %}
Note
- make sure to provide a user when fetching calendar data.
- You can render the calendar anywhere in your application by calling the service and including the Twig template.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-23