PHP code example of ancarebeca / full-calendar-bundle
1. Go to this page and download the library: Download ancarebeca/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/ */
ancarebeca / 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\FullCalendarEvent;
class CalendarEvent extends FullCalendarEvent
{
// Your fields
}
// src/AppBundle/Listener/LoadDataListener.php
namespace AppBundle\Listener;
use AncaRebeca\FullCalendarBundle\Model\FullCalendarEvent;
use AppBundle\Entity\CalendarEvent as MyCustomEvent;
class LoadDataListener
{
/**
* @param CalendarEvent $calendarEvent
*
* @return FullCalendarEvent[]
*/
public function loadData(CalendarEvent $calendarEvent)
{
$startDate = $calendarEvent->getStart();
$endDate = $calendarEvent->getEnd();
$filters = $calendarEvent->getFilters();
//You may want do a custom query to populate the events
$calendarEvent->addEvent(new MyCustomEvent('Event Title 1', new \DateTime()));
$calendarEvent->addEvent(new MyCustomEvent('Event Title 2', new \DateTime()));
}
}
bash
$> php bin/console assets:install web
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.