xipotera/full-calendar-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony3 integration with the library FullCalendar.js

Installs: 110

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 0

Language:JavaScript

Type:symfony-bundle

v1.1.0 2017-04-19 14:32 UTC

This package is not auto-updated.

Last update: 2017-07-27 12:27:15 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

FullCalendar Bundle

We want to build a distribuible bundle for Symfony 3 that allow us to add, edit & show events in the fullCalendar.js 3.3.1 library, calendar and scheduler.

This was based on fados-produccions/fullCalendarBundle repository

How to use it

Install

composer require xipotera/full-calendar-bundle dev-master

register the bundle in the appKernel.php

   new Xipotera\FullCalendarBundle\FullCalendarBundle(),

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.

Usage

Configure you config.yml

# FullCalendar Configuration
full_calendar:
     class_manager: AppBundle\Entity\Calendar

The class parameter contains the Entity that stores the events, this entity must extends from BaseEvent. Create an entity:


namespace AppBundle\Entity;
 
use Doctrine\ORM\Mapping as ORM;
use Xipotera\FullCalendarBundle\Entity\Event as BaseEvent;
 
/**
 * @ORM\Entity
 * @ORM\Table(name="calendarEvents")
 */
class Calendar extends BaseEvent
{
 /**
 * @var int
 *
 * @ORM\Column(name="id", type="integer")
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="AUTO")
 */
 protected $id;
}

Execute from command line, this will create the getters & setters to use on add event

php bin/console doctrine:generate:entities AppBundle

Execute from command line, this will create the entity for the calendar

php bin/console doctrine:schema:update --force

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

# app/config/routing.yml

xipotera_fullcalendar:
    resource: "@FullCalendarBundle/Resources/config/routing.yml"

Publish the assets:

$ php bin/console assets:install web

Translation

Just add on your base.html.twig

<html lang="{{ app.request.locale }}">

Default view

Just add in your bundleController an action with :

public function indexAction() {
    return $this->render( '@FullCalendar/calendar.html.twig' );
}

You could overwrite this init.calendar.js to fit your needs.