|Ratings|| ||Unique User Downloads|| ||Download Rankings|
|Not enough user ratings||Total: 190 ||All time: 8,560 This week: 117|
This package can be used to create 'Add to my google calendar' link for a page.
It can take several parameters to configure the details of a given event, so it can generate HTML for a link on a page that when the user clicks on it will be added to his Google Calendar.
Currently it takes parameters to define event details like:
- Event name
- Event start date and time zone
- Event duration
- Event location
- Event description
- Event guest email addresses
Prize: One official elePHPant Plush Mascott
|Google Calendar is a popular task scheduling application used by many people.
This package provides a simple way to add a scheduled task to Google Calendar by generating a link with all the parameters of the task.
So when the user clicks on that link, the browser goes to a page of Google Calendar to add the task to his calendar.
This way it becomes simple for a site to add tasks to other people calendars on Google Calendar.
$oLink = new GCalAddEventLink();
$oLink->setSubject('Zoom meeting at christmas day');
$oLink->setDuration('PT1H'); // 1 hour
'We just want to meet us via zoom cause we are not allowed to ' . PHP_EOL .
'meet us at the christmas market :-(' . PHP_EOL . PHP_EOL .
'And this is just a check whether the usual problems caused by' . PHP_EOL .
'German umlauts are correctly intercepted: ä, ö, ü, Ä, Ö, Ü, ß ...'
echo '<h1>Example to add event to google calendar</h1>' . PHP_EOL;
echo '<a target="_blank" href="' . $oLink->getHREF() . '">Add to google calendar</a>' . PHP_EOL;
Create 'Add to my google calendar' Link to your Homepage
This class can generate the HREF value to provide a
Add to my google calendar link to your
Following Data for the event to create is supported:
End Date/Time or Duration(if not set, default duration of 30 min is used)
- `setEnd()` or `setDuration()`
Timezone (if not set, system settings used)
All day Event
Detailed Description (optional)
Create an instance of the GCalAddEventLink class
Set the required information for the event to be generated
Pass the generated HREF to an <a> element on your page
This package can use any PSR-3 compliant logger. The logger is initialized with a NullLogger-object
by default. The logger of your choice have to be passed to the constructor of the GCalAddEventLink class.
If you are not working with a PSR-3 compatible logger so far, this is a good opportunity
to deal with this recommendation and may work with it in the future.
There are several more or less extensive PSR-3 packages available on the Internet.
You can also take a look at the
package and the associated blog
'PSR-3 logging in a PHP application'
as an introduction to this topic.
2020-12-15 Version 1.00
* initial Version
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.