Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Google日历API:事件描述和位置不适用于插入方法_Php_Api_Calendar_Google Calendar Api - Fatal编程技术网

Php Google日历API:事件描述和位置不适用于插入方法

Php Google日历API:事件描述和位置不适用于插入方法,php,api,calendar,google-calendar-api,Php,Api,Calendar,Google Calendar Api,我的应用程序通过日历API创建Google日历事件。我能够连接到API并使用PHP以编程方式创建事件 但是,我似乎无法传递位置和描述值。其他值(如Summary、ID、Start和End)工作正常 位置和描述不会显示在谷歌日历中。为什么不呢 这是我的密码: $event_data = new Google_Service_Calendar_Event(array( 'summary' => html_entity_decode($title),

我的应用程序通过日历API创建Google日历事件。我能够连接到API并使用PHP以编程方式创建事件

但是,我似乎无法传递位置和描述值。其他值(如Summary、ID、Start和End)工作正常

位置和描述不会显示在谷歌日历中。为什么不呢

这是我的密码:

    $event_data = new Google_Service_Calendar_Event(array(
        'summary'     => html_entity_decode($title),
        'id'          => $event_id,
        'location'    => '123 Fake Street',
        'description' => 'This is the event description.',
        'start'       => array(
            'date'      => $start_date,
            'timeZone'  => 'America/Vancouver'
         ),
        'end'         => array(
            'date'      => $end_date,
            'timeZone'  => 'America/Vancouver'
        )
  ));

  try {

   $event = $calendar_service->events->insert($calendar, $event_data);

  } catch ( Exception $e ) {

    echo '<h1>Oh no!</h1>';
    echo '<p>There was an error connecting with Google Calendar:</p>';
    echo '<pre>';
      echo $e->getMessage();
    echo '</pre>';
    die();
  }
$event\u data=新的Google\u服务\u日历\u事件(数组)(
“摘要”=>html\u实体\u解码($title),
'id'=>$event\u id,
“位置”=>“123假街”,
“描述”=>“这是事件描述。”,
“开始”=>数组(
“日期”=>$start\u日期,
“时区”=>“美国/温哥华”
),
'结束'=>数组(
“日期”=>$end\u日期,
“时区”=>“美国/温哥华”
)
));
试一试{
$event=$calendar\u service->events->insert($calendar$event\u data);
}捕获(例外$e){
回声‘哦,不!’;
echo'连接谷歌日历时出错:

; 回声'; echo$e->getMessage(); 回声'; 模具(); }

谢谢

我看不出你的代码有任何错误。你能提供日志吗?谢谢调查。不幸的是,日志只显示了一些我已经修复的无关语法错误。我看不到您的代码有任何错误。你能提供日志吗?谢谢调查。不幸的是,日志只显示了一些我已经修复的无关语法错误。