dev-master
9999999-devYii extension for the Arshaw's FullCalendar jQuery plugin
MIT
The Requires
- php >=5.4.0
framework extension yii widget fullcalendar
Wallogit.com
2017 © Pedro Peláez
Yii extension for the Arshaw's FullCalendar jQuery plugin
By Alexey Samoylov (alexey.samoylov@gmail.com)., (*1)
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);
}
Yii extension for the Arshaw's FullCalendar jQuery plugin
MIT
framework extension yii widget fullcalendar