kriss/yii2-calendar-schedule

Yii2 日历调度

安装次数: 3,613

依赖: 0

推荐者: 0

安全: 0

星标: 9

关注者: 3

分支: 6

公开问题: 0

类型:yii2-extension

v2.1 2021-12-03 01:30 UTC

This package is auto-updated.

Last update: 2024-08-29 04:37:45 UTC


README

Yii2 FullCalendar 调度

安装

composer require kriss/yii2-calendar-schedule

提示

master 分支在 2.x,需要 1.x 版本?请查看 1.x 分支

用法

use kriss\calendarSchedule\widgets\FullCalendarWidget;
use kriss\calendarSchedule\widgets\processors\EventProcessor;
use kriss\calendarSchedule\widgets\processors\HeaderToolbarProcessor;
use kriss\calendarSchedule\widgets\processors\LocaleProcessor;

echo FullCalendarWidget::widget([
    'calendarRenderBefore' => "console.log('before', calendar)",
    'calendarRenderAfter' => "console.log('after', calendar)",
    'clientOptions' => [
        // all options from fullCalendar
    ],
    'processors' => [
        // quick solve fullCalendar options
        new LocaleProcessor([
            'locale' => 'zh-cn',
        ]),
        new HeaderToolbarProcessor(),
        new EventProcessor([
            // use Array
            /*'events' => [
                ['title' => 'aaa', 'start' => time(), 'end' => time() + 10 * 3600],
            ],*/
            // use Ajax
            'events' => ['site/events'], // see FullCalendarEventsAction
        ]),
    ],
]);

更多请查看 演示