<?php /** * * Example2: This example shows you how to generate an invite, save it * to file and download it at a later time. * */ require "settings.php"; use IcsGenerator\Invite; $invite = new Invite(); $invite->setSummary("Test Demo Invite")->setDescription("The is a test invite for you to see how this thing actually works")->setStart(new DateTime('2012-05-10 01:00PM EDT'))->setEnd(new DateTime('2012-05-10 02:00PM EDT'))->setLocation("Queens, New York")->setOrganizer("*****@*****.**", "John Doe")->addAttendee("*****@*****.**", "Ahmad Amin")->generate()->save(); // save it to a file // as you may notice this is a static method // it is indipendent of the object. $download_link = Invite::getSavedPath(); ?> <a href="<?php echo $download_link; ?> " >Dowload Invite</a>
<?php /** * This example shows you the basic was to use the invite feature * where you create and download the invite at the sametime. * * Look at example2.php for a more advance usage method. */ require "settings.php"; use IcsGenerator\Invite; // a full day event $invite = new Invite(); $invite->setSummary("Test Demo Invite")->setDescription("The is a test invite for you to see how this thing actually works")->setStart(new DateTime('2013-03-16 12:00AM EST'))->setEnd(new DateTime('2013-03-16 11:59PM EST'))->setAllDay(true)->setLocation("Queens, New York")->setOrganizer("*****@*****.**", "John Doe")->addAttendee("*****@*****.**", "Ahmad Amin")->download(); exit; // or a single part event $invite = new Invite(); $invite->setSummary("Test Demo Invite")->setDescription("The is a test invite for you to see how this thing actually works")->setStart(new DateTime('2013-03-16 08:00AM EST'))->setEnd(new DateTime('2013-03-16 10:00AM EST'))->setLocation("Queens, New York")->setOrganizer("*****@*****.**", "John Doe")->addAttendee("*****@*****.**", "Ahmad Amin")->download(); exit;