PHP code example of szabogyula / full-calendar-bundle

1. Go to this page and download the library: Download szabogyula/full-calendar-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

szabogyula / full-calendar-bundle example snippets


// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new AncaRebeca\FullCalendarBundle\FullCalendarBundle(),
    );
}

// src/AppBundle/Entity/EventCustom.php



namespace AppBundle\Entity;

use AncaRebeca\FullCalendarBundle\Model\Event as BaseEvent;

class CalendarEvent extends BaseEvent
{
	// Your fields 
}

// src/AppBundle/Listener/LoadDataListener.php



namespace AppBundle\Listener;

use AncaRebeca\FullCalendarBundle\Model\Event;

class LoadDataListener
{
    /**
     * @param CalendarEvent $calendarEvent
     *
     * @return EventInterface[]
     */
    public function loadData(CalendarEvent $calendarEvent)
    {
    	 $startDate = $calendarEvent->getStartDatetime();
   		 $endDate = $calendarEvent->getEndDatetime();
		 $filters = $calendarEvent->getFilters();
	
    	 //You may want do a custom query to populate the events
    	 
    	 $calendarEvent->addEvent(new Event('Event Title 1', new \DateTime());
    	 $calendarEvent->addEvent(new Event('Event Title 2', new \DateTime()));
    }
}