PHP code example of claudejanz / yii2-fullcalendar

1. Go to this page and download the library: Download claudejanz/yii2-fullcalendar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

claudejanz / yii2-fullcalendar example snippets


echo \claudejanz\yii2fullcalendar\Fullcalendar::widget([
    'clientOptions' => [
        'events'        => \yii\helpers\Url::to(['site/events']),
        'weekends'      => false,
        'defaultView'   => 'agendaWeek',
        'editable'      => false,
        'header'        => [
            'left'  => 'prev,next today ',
            'right' => 'month,agendaWeek,agendaDay'
        ],
    ]
]);

public function actionEvents($start=NULL,$end=NULL,$timestamp=NULL){

    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

    $format = \DateTime::ISO8601;

    $events = [];

    $date = new \DateTime('now');

    $event = new \claudejanz\yii2fullcalendar\models\Event();
    $event->title = "An event";
    $event->start = $date->format($format);
    $date->add(new \DateInterval('PT1H'));
    $event->end = $date->format($format);

    $events[] = $event;

    return $events;
  }

php composer.phar