tattali/calendar-bundle
Composer 安装命令:
composer require tattali/calendar-bundle
包简介
Provides event calendar for your Symfony 8+ project. Compatible with API like Google Calendar.
README 文档
README
This bundle allow you to integrate FullCalendar.js library in your Symfony 5.4 to 8 project.
Documentation
The source of the documentation is stored in the docs/ folder in this bundle
Installation
composer require tattali/calendar-bundle
Import the routes:
# config/routes/calendar.yaml calendar: resource: '@CalendarBundle/config/routing.yaml'
Quick Start
Create a subscriber to populate calendar data:
// src/EventSubscriber/CalendarSubscriber.php <?php namespace App\EventSubscriber; use CalendarBundle\Entity\Event; use CalendarBundle\Event\SetDataEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class CalendarSubscriber implements EventSubscriberInterface { public static function getSubscribedEvents(): array { return [ SetDataEvent::class => 'onCalendarSetData', ]; } public function onCalendarSetData(SetDataEvent $setDataEvent): void { $start = $setDataEvent->getStart(); $end = $setDataEvent->getEnd(); $filters = $setDataEvent->getFilters(); // You may want to make a custom query from your database to fill the calendar $setDataEvent->addEvent(new Event( 'Event title', new \DateTime('Tuesday this week'), new \DateTime('Wednesday this week') )); // If the end date is null or not defined, it creates a all day event $setDataEvent->addEvent(new Event( 'All day event', new \DateTime('Friday this week') )); } }
Add the calendar to your template:
{% block body %}
<div id="calendar-holder"></div>
{% endblock %}
{% block javascripts %}
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.11/index.global.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
new FullCalendar.Calendar(document.getElementById('calendar-holder'), {
initialView: 'dayGridMonth',
eventSources: [{
url: '/fc-load-events',
method: 'POST',
extraParams: { filters: JSON.stringify({}) }
}]
}).render();
});
</script>
{% endblock %}
Documentation
- Configuration - Caching, JSON depth limit, routing
- Doctrine CRUD - Create, update, delete events with Doctrine
- Webpack Encore - ES6 module setup
- Multi-calendar - Multiple calendars on one page
- Security - Securing the endpoint
Upgrade Guides
Troubleshooting
Debug AJAX requests using browser Network monitor (Ctrl+Shift+E Firefox, Ctrl+Shift+I Chrome).
License
MIT - See LICENSE
tattali/calendar-bundle 适用场景与选型建议
tattali/calendar-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 585.47k 次下载、GitHub Stars 达 169, 最近一次更新时间为 2019 年 03 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「calendar」 「fullcalendar」 「symfony calendar」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tattali/calendar-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tattali/calendar-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tattali/calendar-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The bundle for easy using json-rpc api on your project
A modern PHP library for generating iCalendar v2.0 events
Yii2 fullcalendar widget (fork)
A fullcalendar implementation for TYPO3 CMS
A powerful event calendar Tool for Laravel's Nova 5.
Check for holidays - localeaware
统计信息
- 总下载量: 585.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 175
- 点击次数: 36
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-24
