adesigns / calendar-bundle

This bundle allows you to integrate the jQuery FullCalendar plugin into your Symfony2 application.
MIT License
97 stars 60 forks source link

I didnt get events of Full Calendar Bundle #30

Closed m4ru closed 9 years ago

m4ru commented 9 years ago

Hi,

I saw many subject about this and i'm really desperate about make this function. I hope this is a little issue and you'll see in a second because i'm quite stuck.

My calendar is loading without problem, i see in firebug, the fc-load-event functions loading without problems but the response is empty i have no events on my calendar. Here are content of my file

app/config/config.yml : services: ptrav.docadm.calendar_listener: class: PTrav\CalendrierBundle\EventListener\CalendarEventListener tags:

PTrav\CalendrierBundle\EventListener\CalendarEventListener: <?php

namespace PTrav\CalendrierBundle\EventListener;

use ADesigns\CalendarBundle\Event\CalendarEvent; use ADesigns\CalendarBundle\Entity\EventEntity; use Doctrine\ORM\EntityManager;

class CalendarEventListener { private $entityManager;

public function __construct(EntityManager $entityManager)
{
    $this->entityManager = $entityManager;

}

public function loadEvents(CalendarEvent $calendarEvent)
{
    $startDate = $calendarEvent->getStartDatetime();
    $endDate = $calendarEvent->getEndDatetime();
         // i simplified the event
        $eventEntity = new EventEntity("Title Oh yeah", $startDate,$endDate,false);

        //optional calendar event settings
        $eventEntity->setAllDay(true); // default is false, set to true if this is an all day event
        $eventEntity->setBgColor('#FF0000'); //set the background color of the event's label
        $eventEntity->setFgColor('#FFFFFF'); //set the foreground color of the event's label
        $eventEntity->setUrl('http://www.google.com'); // url to send user to when event label is clicked
        $eventEntity->setCssClass('my-custom-class'); // a custom class you may want to apply to event labels
        //finally, add the event to the CalendarEvent for displaying on the calendar
        $calendarEvent->addEvent($eventEntity);
    }

} ?>

Part of my main layout : {# FOSJsRouting #}

<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
{# calendar #}
<script type="text/javascript" src="{{ asset('bundles/adesignscalendar/js/jquery/jquery-1.8.2.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/adesignscalendar/js/fullcalendar/jquery.fullcalendar.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/adesignscalendar/js/calendar-settings.js') }}"></script>

Part of the view : {% include 'ADesignsCalendarBundle::calendar.html.twig' %}

Thanks in advance !

mikeyudin commented 9 years ago

My guess is that this is a configuration issue, and has been resolved since then?