I am new in zf2 and i use fullcalender to show events of calender for this
i make a loadaction who return me response like:
[{"event_id":"2","calendar_id":"1","author_id":"1","title":"Launch","description":"Launch
Break","begin":"2014-03-02 20:00:00","end":"2014-03-31
16:53:00","calendar_title":"Hijri
Calender","author_email":"[email protected]"},{"event_id":"79","calendar_id":"1","author_id":"1","title":"cccvcv","description":"bcbcbbcbbcbccbcbb","begin":"2014-03-31
21:00:00","end":"2014-04-08 11:16:00","calendar_title":"Hijri
Calender","author_email":"[email protected]"},{"event_id":"80","calendar_id":"1","author_id":"1","title":"dgdgdgdgdgdg","description":"dgdgdgdgdg","begin":"2014-04-01
21:00:00","end":"2014-04-08 11:17:00","calendar_title":"Hijri
Calender","author_email":"[email protected]"}]
and here is my loadaction:
public function loadAction()
{
$response = $this->getResponse();
//if ($request->isPost()) {
$id = (int) $this->params()->fromRoute('id', 0);
if ($id) {
$events =
$this->getEventTable()->fetchAllByCalendar($id);
$response->setContent(\Zend\Json\Json::encode($events));
}
//}
return $response;
}
and here is my calender show code:
public function showAction()
{
if ($this->zfcUserAuthentication()->hasIdentity())
{
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) {
return $this->redirect()->toRoute('calendar', array(
'action' => 'create'
));
}
$calendar = $this->getCalendarTable()->getCalendar($id);
return array('calendar' => $calendar);
}
else
{
$this->redirect()->toRoute('zfcuser/login');
}
}
how i use this json data of events for showing events on calender?
Any advice should Appriciated
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.