There is no license information available for the latest version (dev-master) of this package.

This package offers PHP-classes to create iCal compatible *.ics files.

dev-master 2012-09-28 11:43 UTC

This package is not auto-updated.

Last update: 2024-04-21 01:08:23 UTC


README

This package offers PHP-classes to create iCal compatible *.ics files.

Usage

1. Create a Calendar object

$vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com');

2. Create an Event object

$vEvent = new \Eluceo\iCal\Component\Event();

3. Add your information to the Event

$vEvent->setDtStart(new \DateTime('2012-12-24'));
$vEvent->setDtEnd(new \DateTime('2012-12-24'));
$vEvent->setNoTime(true);
$vEvent->setSummary('Christmas');

4. Add Event to Calendar

$vCalendar->addEvent($vEvent);

5. Set HTTP-headers

header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename="cal.ics"');

6. Send output

echo $vCalendar->render();