Hello all,
I am trying to use this extension:
FullCalendar
However when I do so it would appear the external java and css files needed for this don’t link properly.
I assume I have missed something in the link above, but I can’t see what I have done wrong.
Here is what the console reports when I load the page:
GET http://localhost/sandbox/admin/assets/ba9ba9aa/fullcalendar.print.css [HTTP/1.1 404 Not Found 0ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/fullcalendar.css [HTTP/1.1 404 Not Found 0ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/fullcalendar.js [HTTP/1.1 404 Not Found 5ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/gcal.js [HTTP/1.1 404 Not Found 15ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/lang-all.js [HTTP/1.1 404 Not Found 14ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/lang/en-US.js [HTTP/1.1 404 Not Found 14ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/fullcalendar.js [HTTP/1.1 404 Not Found 1ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/gcal.js [HTTP/1.1 404 Not Found 1ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/lang-all.js [HTTP/1.1 404 Not Found 1ms]
GET http://localhost/sandbox/admin/assets/ba9ba9aa/lang/en-US.js [HTTP/1.1 404 Not Found 0ms]
TypeError: $(...).fullCalendar is not a function index.php:280
So, I have the following code:
views\calendar\index.php
<?php
$events = array();
//Testing
$Event = new \yii2fullcalendar\models\Event();
$Event->id = 1;
$Event->title = 'Testing';
$Event->start = date('Y-m-d\TH:m:s\Z');
$events[] = $Event;
$Event = new \yii2fullcalendar\models\Event();
$Event->id = 2;
$Event->title = 'Testing';
$Event->start = date('Y-m-d\TH:m:s\Z',strtotime('tomorrow 6am'));
$events[] = $Event;
?>
<div class="calendar-index">
<?= \yii2fullcalendar\yii2fullcalendar::widget(array(
'events'=> $events,
));?>
</div>
CalendarController.php
<?php
namespace backend\controllers;
use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
/**
* Site controller
*/
class CalendarController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* @inheritdoc
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
public function actionIndex()
{
return $this->render('index');
}
}