I’m building a calendar app in yii 1.1 and i want to display it via fullcalendar.
i cant seems to display the fullcalendar. been trying to for the past few hours.
here is the structure of my yii website:
* protected
** modules
*** Calculation
**** extensions
***** JcalFullWidget
****** views
******* jcal_fullsize.php
**** lib
***** fullcalendar
****** fullcalendar.js
****** lib
******* jquery.min.js
******* moment.min.js
******* fullcalendar.css
I want to display my fullcalendar in the jcal_fullsize.php
widget
here is the code:
protected\modules\Calculation\extensions\JcalFullWidget\views\jcal_fullsize.php
:
<?php
$cs=Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$cs->registerCoreScript( 'jquery.ui' );
$cs->registerScriptFile("/../../../lib/fullcalendar/lib/jquery.min.js");
$cs->registerScriptFile("/../../../lib/fullcalendar/lib/moment.min.js");
$cs->registerScriptFile("/../../../lib/fullcalendar/fullcalendar.js");
$cs->registerCssFile("/../../../lib/fullcalendar/fullcalendar.css");
$cs->registerCssFile("/../../../lib/fullcalendar/fullcalendar.print.css");
$cs->registerScript(
'fullSizeCalendar',
'
alert("Hello! 1!");
$(document).ready(function() {
$("#calendar").fullCalendar({
})
});
alert("Hello!2 !");
',
CClientScript::POS_READY
);
?>
<div id='calendar'></div>
protected\config\main.php
:
'components'=>array(
'clientScript' => array(
'coreScriptPosition' => CClientScript::POS_END,
'defaultScriptFilePosition' => CClientScript::POS_END,
),
)
this code do not display the fullcalendar. but the 2 alerts boxes do work.
anybody knows what is the problem an can please help me?
many thanks!