anybody knows how to add events from MySQL database without using this json-events.html? can I render my data from my controller like this :
public function actionGetTasks() {
$query = Yii::app()->db->createCommand('SELECT TASKID, STARTTIME, ENDTIME
FROM task');
$result = $query->queryAll();
foreach ($result as $row) {
$data[] = array(
'id' => $row['TASKID'],
'title' => $row['TASKNAME'],
'start' => $row['STARTTIME'],
'end' => $row['ENDTIME'],
'allDay' => false,
);
}
echo str_replace("'", '"', json_encode($data));
}
and my view (calendar.php):
<div class="two_third maincontent_inner">
<div class="left">
<?php
$this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget',
array(
'data' => array(
'title' => 'All Day Event',
'start' => date('Y-m-j')//events from database should be here
),
'options' => array(
'selectable' => true,
'header' => array(
'left' => 'prev,next today',
'center' => 'title',
'right' => 'month,agendaWeek,agendaDay'
),
),
'htmlOptions' => array(
),
)
);
?>
<br />
</div><!-- left -->
</div><!-- two_third -->
and how to change the ‘data’=>array so it can read and put the events from my controller?
thanks in advance.