2017 © Pedro Peláez
 

yii-extension yii-fullcalendar

Yii extension for the Arshaw's FullCalendar jQuery plugin

image

lagman/yii-fullcalendar

Yii extension for the Arshaw's FullCalendar jQuery plugin

  • Wednesday, February 12, 2014
  • by lagman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii extension for the Arshaw's FullCalendar jQuery plugin

By Alexey Samoylov (alexey.samoylov@gmail.com)., (*1)

Requirements

  • PHP 5.4
  • Yii 1.x

Examples

Global component configuration example:, (*2)

'components' => [
    'fullcalendar' => [
        'class' => 'ext.yii-fullcalendar.FullCalendar',
            'options' => [
                'buttonText' => [
                    'today' => 'Сегодня',
                    'week' => 'Неделя',
                    'day' => 'День',
                ],
                'allDayDefault' => false,
            ],
        ],
    ],

Usage example:, (*3)

View:, (*4)

<?php $this->widget('ext.yii-fullcalendar.FullCalendarWidget', [ 'options' => [
    'defaultView' => 'agendaWeek',
    'header' => [
        'left' => 'prev,next today',
        'center' => 'title',
        'right' => 'agendaWeek, agendaDay',
    ],
    'allDaySlot' => false,
    'editable' => false,
    'buttonText' => [
        'today' => 'Сегодня',
        'week' => 'Неделя',
        'day' => 'День',
    ],
    'slotMinutes' => 15,
    'height' =>  5000,
    'minTime' => '08:00',
    'maxTime' => '20:00',
    'events' => [],
    'eventSources' => [
        [
            'url' => Yii::app()->request->url,
            'type' => 'POST',
            'data' => [
                'ajax' => true,
            ],
            'error' => "js:function() {
                alert('Ошибка загрузки данных!');
            }",
            'color' => 'green',
            'textColor' => 'black',
        ]
    ],
]]);
?>

Controller:, (*5)

public function actionCalendar()
{
    if (Yii::app()->request->isAjaxRequest) {
        $this->generateCalendarEvents();
        Yii::app()->end();
    }

    $this->render('calendar');
}

public function generateCalendarEvents()
{
    $events = [
        [ 'title' => 'sample event 1', 'start' => time() ],
    ];

    echo CJSON::encode($events);
}

The Versions

12/02 2014

dev-master

9999999-dev

Yii extension for the Arshaw's FullCalendar jQuery plugin

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework extension yii widget fullcalendar