webbuilders-group / silverstripe-gridfield-calendar-view
一个将 GridField 的数据以日历形式查看的组件
3.1.0
2024-04-30 20:29 UTC
Requires
- silverstripe/framework: ~4.11|^5.0
README
一个将 GridField 的数据以日历形式查看的组件,适用于事件日历等。它还提供了一个切换按钮,允许您在 GridField 的默认列表视图和日历视图之间切换。
维护者联系方式
- Ed Chipman (UndefinedOffset)
要求
- SilverStripe 框架 4.2+ | 5.0+
安装
Composer(推荐)
composer require webbuilders-group/silverstripe-gridfield-calendar-view
如果您愿意,也可以手动安装
- 从这里下载模块 https://github.com/webbuilders-group/silverstripe-gridfield-calendar-view/releases
- 将下载的存档解压到您的网站根目录中,以便目标文件夹名为 gridfield-calendar-view,解压后的文件夹应包含根目录中的 _config.php 文件以及其他文件/文件夹
- 运行 dev/build?flush=all 以重新生成清单
快速入门
要开始,您需要一个可以渲染为日历项的对象。然后您需要将 GridFieldCalendarView
组件添加到 GridField 的配置中。例如
$myGridField=new GridField('Events', 'Events', $this->Events(), GridFieldConfig_RecordEditor::create(10)); $myGridField->getConfig()->addComponent(new GridFieldCalendarView( 'StartDateTimeField', //This must be the name of the field in the model not a getter method 'EndDateTimeField' ));
还有更多选项可供选择,有关这些选项的信息,请参阅 文档 以获取更多信息。