PHPackages                             adexerivera/calendar-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. adexerivera/calendar-bundle

ActiveSymfony-bundle

adexerivera/calendar-bundle
===========================

This bundle allows you to integrate the jQuery FullCalendar plugin into your Symfony2 application.

08CSS

Since Sep 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/adexerivera/calendar-bundle)[ Packagist](https://packagist.org/packages/adexerivera/calendar-bundle)[ RSS](/packages/adexerivera-calendar-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

CalendarBundle - jQuery fullcalendar bundle.
============================================

[](#calendarbundle---jquery-fullcalendar-bundle)

This bundle allows you to integrate the [jQuery FullCalendar](http://arshaw.com/fullcalendar/) plugin into your Symfony2 application.

Once installed, this bundle will use event listeners to load events from any bundle in your application.

Installation
------------

[](#installation)

Before installing, please note that this bundle has a dependency on the [FOSJsRouting](https://github.com/FriendsOfSymfony/FOSJsRoutingBundle) bundle to expose the calendar AJAX event loader route. Please ensure that the FOSJsRouting bundle is installed and configured before continuing.

### Through Composer (Symfony 2.1+):

[](#through-composer-symfony-21)

Add the following lines in your `composer.json` file:

```
"require": {
    "adesigns/calendar-bundle": "dev-master"
}
```

Run Composer to download and install the bundle:

```
$ php composer.phar update adesigns/calendar-bundle

```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new ADesigns\CalendarBundle\ADesignsCalendarBundle(),
    );
}
```

Register the routing in `app/config/routing.yml`:

```
# app/config/routing.yml

adesigns_calendar:
  resource: "@ADesignsCalendarBundle/Resources/config/routing.xml"
```

Publish the assets:

```
$ php app/console assets:install web

```

Usage
-----

[](#usage)

Add the required stylesheet and javascripts to your layout:

Stylesheet:

```

```

Javascript:

```

```

Then, in the template where you wish to display the calendar, add the following twig:

```
{% include 'ADesignsCalendarBundle::calendar.html.twig' %}

```

Adding Events
-------------

[](#adding-events)

The best part about this bundle is that you can add events to the calendar from any part of your application. The calendar loads events via AJAX, and dispatches an event to load calendar events from your application.

When a request is made to load events for a given start/end time, the bundle dispatches a `calendar.load_events` event. Adding event listeners is an easy 2 step process

Create an Event Listener class in your bundle:

```
// src/Acme/DemoBundle/EventListener/CalendarEventListener.php

namespace Acme\DemoBundle\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();

		// load events using your custom logic here,
		// for instance, retrieving events from a repository

		$companyEvents = $this->entityManager->getRepository('AcmeDemoBundle:MyCompanyEvents')
			              ->createQueryBuilder('company_events')
			              ->where('company_events.event_datetime BETWEEN :startDate and :endDate')
			              ->setParameter('startDate', $startDate->format('Y-m-d H:i:s'))
			              ->setParameter('endDate', $endDate->format('Y-m-d H:i:s'))
			              ->getQuery()->getResults();

		foreach($companyEvents as $companyEvent) {

		    // create an event with a start/end time, or an all day event
		    if ($companyEvent->getAllDayEvent() === false) {
		    	$eventEntity = new EventEntity($companyEvent->getTitle(), $companyEvent->getStartDatetime(), $companyEvent->getEndDatetime());
		    } else {
		    	$eventEntity = new EventEntity($companyEvent->getTitle(), $companyEvent->getStartDatetime(), null, true);
		    }

		    //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);
		}
	}
}
```

Additional properties and customization of each event on the calendar can be found in the Entity/EventEntity class.

Then, add the listener to your services:

```

```

And that's it! When the `ADesignsCalendarBundle::calendar.html.twig` template is rendered, any events within the current month/day/year will be pulled from your application.

###  Health Score

20

—

LowBetter than 16% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d1407c9b2fbb7428144751db3f1742f6cc87ed471aa9f7b5df6e6d58be46516?d=identicon)[adexerivera](/maintainers/adexerivera)

---

Top Contributors

[![mikeyudin](https://avatars.githubusercontent.com/u/981848?v=4)](https://github.com/mikeyudin "mikeyudin (25 commits)")[![robtec20](https://avatars.githubusercontent.com/u/20225134?v=4)](https://github.com/robtec20 "robtec20 (10 commits)")[![philkingston](https://avatars.githubusercontent.com/u/2652699?v=4)](https://github.com/philkingston "philkingston (9 commits)")[![adexerivera](https://avatars.githubusercontent.com/u/1585009?v=4)](https://github.com/adexerivera "adexerivera (4 commits)")[![varavan](https://avatars.githubusercontent.com/u/761880?v=4)](https://github.com/varavan "varavan (1 commits)")

### Embed Badge

![Health badge](/badges/adexerivera-calendar-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/adexerivera-calendar-bundle/health.svg)](https://phpackages.com/packages/adexerivera-calendar-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
