kriss/yii2-calendar-schedule

Yii2 Calendar Schedule

Installs: 1 219

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 2

Forks: 5

Open Issues: 0

Type:yii2-extension

v2.0 2021-03-16 01:40 UTC

This package is auto-updated.

Last update: 2021-10-21 15:17:48 UTC


README

Yii2 FullCalendar Schedule

Installation

composer require kriss/yii2-calendar-schedule

Tip

master is in 2.x, want 1.x ? see 1.x branch

Usage

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
        ]),
    ],
]);

more see demos