我的网站上有一个嵌入式日历,我希望允许用户将事件添加到日历中,我将如何使用 PHP 来解决这个问题?
我查看了 Google API 文档,但无法理解如何实现他们的示例,请参见下文:
$calendarListEntry = new CalendarListEntry();
$calendarListEntry->setId("calendarId");
$createdCalendarListEntry = $service->calendarList->insert($calendarListEntry);
echo $createdCalendarListEntry->getSummary();
目前我的代码看起来像这样;
<?php
require_once '../google-api-php-client/src/Google_Client.php';
require_once '../google-api-php-client/src/contrib/Google_CalendarService.php';
$calendarListEntry = new CalendarListEntry();
$calendarListEntry->setId("cdnavechicleservices@gmail.com");
$createdCalendarListEntry = $service->calendarList->insert($calendarListEntry);
echo $createdCalendarListEntry->getSummary();
?>