PHP code example of cti / ics

1. Go to this page and download the library: Download cti/ics library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cti / ics example snippets


// initialise calendar
$calendar = new Calendar('Automated Test', 'Europe/London');

// add events to it
$calendar->add(new Event\Interval('2015-03-13 10:05:00', '2015-03-13 10:19:59', 'Daily scrum'));
$calendar->add(new Event\Interval('2015-03-13 10:30:00', '2015-03-13 10:49:59', 'Weekly project review'));

$path = '/tmp/generated.ics';
$generator = new Generator(new FileOutput($path));
$generator->calendar($calendar)->getOutput()->getAll();

// grab the output in a string for later usage
$generator = new Generator(new StringOutput());
$output = $generator->calendar($calendar)->getOutput()->getAll();