https://github.com/welpdev/icalbundle
Symfony Bundle to manage .ics iCal file (creating and eventually reading)
https://github.com/welpdev/icalbundle
bundle ics-ical packagist php symfony symfony-bundle
Last synced: 12 months ago
JSON representation
Symfony Bundle to manage .ics iCal file (creating and eventually reading)
- Host: GitHub
- URL: https://github.com/welpdev/icalbundle
- Owner: welpdev
- License: mit
- Created: 2016-11-23T15:53:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-24T12:54:09.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T16:04:01.143Z (about 1 year ago)
- Topics: bundle, ics-ical, packagist, php, symfony, symfony-bundle
- Language: PHP
- Size: 19.5 KB
- Stars: 10
- Watchers: 1
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# icalBundle
[](https://travis-ci.org/welpdev/icalBundle)
[](https://packagist.org/packages/welp/ical-bundle)
[](https://packagist.org/packages/welp/ical-bundle)
[](https://github.com/welpdev/icalBundle/blob/master/LICENSE)
Symfony Bundle to manage .ics iCal file (creating and eventually reading)
use of the library:
## Setup
Add bundle to your project:
```bash
composer require welp/ical-bundle
```
Add `Welp\IcalBundle\WelpIcalBundle` to your `AppKernel.php`:
```php
$bundles = [
// ...
new Welp\IcalBundle\WelpIcalBundle(),
];
```
## Configuration
In your `config.yml`:
```yaml
welp_ical:
default_timezone: "Europe/Paris"
default_prodid: "-//WelpIcalBundle//Calendar App//FR"
```
## Usage
``` php
get('welp_ical.factory');
//Create a calendar
$calendar = $icalFactory->createCalendar();
//Create an event
$eventOne = $icalFactory->createCalendarEvent();
$eventOne->setStart(new \DateTime())
->setSummary('Family reunion')
->setUid('event-uid');
//add an Attendee
$attendee = $icalFactory->createAttendee();
$attendee->setValue('moe@example.com')
->setName('Moe Smith');
$eventOne->addAttendee($attendee);
//set the Organizer
$organizer = $icalFactory->createOrganizer();
$organizer->setValue('titouan@welp.fr')
->setName('Titouan BENOIT')
->setLanguage('fr');
$eventOne->setOrganizer($organizer);
//new event
$eventTwo = $icalFactory->createCalendarEvent();
$eventTwo->setStart(new \DateTime())
->setSummary('Dentist Appointment')
->setUid('event-uid');
$calendar
->addEvent($eventOne)
->addEvent($eventTwo);
$headers = array();
$calendarResponse = new Welp\IcalBundle\Response\CalendarResponse($calendar, 200, $headers);
return $calendarResponse;
}
```