I am newbie in yii and fullcalendar, i have - events.php:`
try {
$events = array();
$query = Yii::app()->db->createCommand("SELECT schedules.start_at, schedules.end_at, timetables.name,terminals.name FROM schedules, terminals, timetables WHERE schedules.terminal_id = terminals.id and timetables.id = schedules.timetable_id");
$rows = $query->queryAll();
foreach($rows as $row){
$e = array();
$e['title'] = $row['name'];
$e['start'] = $row['start_at'];
// Merge the event array into the return array
array_push($events, $e);
}
echo json_encode($events);
exit();
} catch (PDOException $e) {
print "Error!";
}
Yii::app()->end();
}
?>`
I can feed json from events.php in class calendar.php
events:
{
url:'events.php'
}
Please help me how to call json "url:" by yii.