thelia/full-calendar-module

安装: 23

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 8

分支: 1

开放问题: 0

类型:thelia-module

1.0 2015-08-15 10:22 UTC

This package is auto-updated.

Last update: 2024-09-14 22:22:02 UTC


README

此模块可以轻松地将FullCalendar集成到Thelia 2中

安装

手动

  • 将模块复制到 <thelia_root>/local/modules/ 目录中,并确保模块的名称为FullCalendar。
  • 在Thelia管理面板中激活它

Composer

在项目目录中执行此命令

$ composer require thelia/full-calendar-module:~1.0

使用方法

此模块添加了一个smarty函数,用于为您创建日历。

{calendar} 函数有4个可选参数

  • id: 日历容器的ID。如果未使用此参数,ID将为 fullcalendar,后跟一个递增数字。例如:fullcalendar0, fullcalendar1, ...
  • class: 日历容器的类。默认情况下,会自动添加类 thelia-fullcalendar。此参数可以是数组或字符串。例如:class=["foo", "bar"]class="foo bar"
  • options: 此参数允许您提供 fullcalendar javascript方法的参数。此参数必须为数组。例如:函数 {calendar options=["weekends" => 0]} 将添加标签 <div id="fullcalendar0" class="thelia-fullcalendar"></div> 和js片段:$("#fullcalendar0").fullcalendar({weekends: 0});
  • attr: 此参数允许您向日历容器标签添加更多属性。这必须为数组。例如:{calendar attr=["data-id" => 1] 将输出 <div id="fullcalendar0" class="thelia-fullcalendar" data-id="1"></div>

钩子

如果您的模块使用一个或多个钩子,请填写此部分。说明使用了哪些钩子。

此模块使用了两个钩子

  • main.stylesheet:此钩子用于添加FullCalendar的默认样式表(标准版和打印版)
  • main.javascript-initialization:此钩子用于添加Moment和FullCalendarjavascript文件以及日历执行脚本。