PHPackages                             ptrnov/yii2-scheduler-fullcalendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ptrnov/yii2-scheduler-fullcalendar

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

ptrnov/yii2-scheduler-fullcalendar
==================================

Yii2 scheduler fullcalendar widget

1.0.0(9y ago)1551[1 issues](https://github.com/ptrnov/yii2-scheduler-fullcalendar/issues)BSD-3-ClauseJavaScriptPHP &gt;=5.4.0

Since Sep 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ptrnov/yii2-scheduler-fullcalendar)[ Packagist](https://packagist.org/packages/ptrnov/yii2-scheduler-fullcalendar)[ RSS](/packages/ptrnov-yii2-scheduler-fullcalendar/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Yii2 fullcalendar component
===========================

[](#yii2-fullcalendar-component)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

To install, either run

```
php composer.phar require --prefer-dist ptrnov/yii2-scheduler-fullcalendar "*"

```

or add

```
"ptrnov/yii2-scheduler-fullcalendar": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

See the demos/ folder for all the examples.

### Simple usage with array data

[](#simple-usage-with-array-data)

```
	//==Create file: Controllers/TestControllers.php
	//==paste script below
	namespace app\controllers;
	use Yii;
	use yii\web\Controller;
	use yii\helpers\ArrayHelper;
	use yii\web\Response;
	use yii\widgets\ActiveForm;
	use yii\helpers\Json;
	class TestController extends Controller
	{
		public function actionIndex()
		{
				return $this->render('index');
		}

		public function actionForm($start,$end)
		{
			return $this->renderAjax('form',[
				'start'=>$start,
				'end'=>$end
			]);
		}

		public function actionDropChild($id,$start,$end){
			echo "ID=".$id." START=".$start." EBD=".$end;
			//$model = Pilotproject::findOne(['ID'=>$id]);

			//$model->PLAN_DATE1 = $start;
			//$model->PLAN_DATE2 = $end;

		   // $model->save();
		}

		public function actionEventCalendarSchedule()
		{
			$aryEvent=[
					['id' => '1', 'resourceId' => 'b', 'start' => '2016-05-07T02:00:00', 'end' => '2016-05-07T07:00:00', 'title' => 'event 1'],
					['id' => '2', 'resourceId' => 'c', 'start' => '2016-05-07T05:00:00', 'end' => '2016-05-07T22:00:00', 'title' => 'event 2'],
					['id' => '3', 'resourceId' => 'd', 'start' => '2016-05-06', 'end' => '2016-05-08', 'title' => 'event 3'],
					['id' => '4', 'resourceId' => 'e', 'start' => '2016-05-07T03:00:00', 'end' => '2016-05-07T08:00:00', 'title' => 'event 4'],
					['id' => '5', 'resourceId' => 'f', 'start' => '2016-05-07T00:30:00', 'end' => '2016-05-07T02:30:00', 'title' => 'event 5'],
			];

			return Json::encode($aryEvent);
		}

		public function actionResourceCalendarSchedule()
		{
			$aryResource=[
					['id' => 'a', 'title' => 'Daily Report'],
					['id' => 'b', 'title' => 'Auditorium B', 'eventColor' => 'green'],
					['id' => 'c', 'title' => 'Auditorium C', 'eventColor' => 'orange'],
					[
						'id'       => 'd', 'title' => 'Auditorium D',
						'children' => [
							['id' => 'd1', 'title' => 'Room D1'],
							['id' => 'd2', 'title' => 'Room D2'],
						],
					],
					['id' => 'e', 'title' => 'Auditorium E'],
					['id' => 'f', 'title' => 'Auditorium F', 'eventColor' => 'red'],
					['id' => 'g', 'title' => 'Auditorium G'],
					['id' => 'h', 'title' => 'Auditorium H'],
					['id' => 'i', 'title' => 'Auditorium I'],
					['id' => 'j', 'title' => 'Auditorium J'],
					['id' => 'k', 'title' => 'Auditorium K'],
					['id' => 'l', 'title' => 'Auditorium L'],
					['id' => 'm', 'title' => 'Auditorium M'],
					['id' => 'n', 'title' => 'Auditorium N'],
					['id' => 'o', 'title' => 'Auditorium O'],
					['id' => 'p', 'title' => 'Auditorium P'],
					['id' => 'q', 'title' => 'Auditorium Q'],
					['id' => 'r', 'title' => 'Auditorium R'],
					['id' => 's', 'title' => 'Auditorium S'],
					['id' => 't', 'title' => 'Auditorium T'],
					['id' => 'u', 'title' => 'Auditorium U'],
					['id' => 'v', 'title' => 'Auditorium V'],
					['id' => 'w', 'title' => 'Auditorium W'],
					['id' => 'x', 'title' => 'Auditorium X'],
					['id' => 'y', 'title' => 'Auditorium Y'],
					['id' => 'z', 'title' => 'Auditorium Z'],
				];

			return Json::encode($aryResource);
		}

	}

	//==Create file: views/test/index.php
	//==paste script below
