Download the PHP package adesigns/calendar-bundle without Composer
On this page you can find all versions of the php package adesigns/calendar-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package calendar-bundle
CalendarBundle - jQuery FullCalendar bundle.
This bundle allows you to integrate the jQuery FullCalendar plugin into your Symfony2 application.
Once installed, this bundle will use event listeners to load events from any bundle in your application.
Installation
Before installing, please note that this bundle has a dependency on the FOSJsRouting 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+):
Add the following lines in your composer.json
file:
Register the bundle in app/AppKernel.php
:
Register the routing in app/config/routing.yml
:
Publish the assets:
$ php app/console assets:install web
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:
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:
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.
Extending the Calendar Javascript
You may want to customize the FullCalendar javascript to meet your applications needs. In order to do this, you can copy the calendar-settings.js in Resources/public/js, and modify it to fit your needs. For instance, you can pass custom filters to your event listeners by adding extra parameters in the eventSources method:
All versions of calendar-bundle with dependencies
symfony/framework-bundle Version ~2.1|~3.0
friendsofsymfony/jsrouting-bundle Version ~1.1|~2.0
doctrine/collections Version ^1.0