marcustansoon/spatie-calendar-links-adapter

用于 Spatie/CalenderLinks (Google/iCal/Yahoo 日历) 的 PHP 适配器

v1.1 2020-10-21 09:19 UTC

This package is auto-updated.

Last update: 2024-09-22 11:00:09 UTC


README

#28ed5d 需要PHP版本 >= 7

#28ed5d 需要Spatie/CalendarLinks插件(通过composer安装包。更多信息,请访问 https://github.com/spatie/calendar-links

composer require marcustansoon/spatie-calendar-links-adapter

#28ed5d 示例用法:-

// Import script
require_once __DIR__ . '/vendor/autoload.php';

use marcustansoon\SpatieCalendarLinksAdapter;

// Create calendar links
        $calendarLinks = SpatieCalendarLinksAdapter::create(
            (object)[
                'from' => '2020-10-28 18:00',
                'to' => '2020-10-28 21:40',
                // List of supported timezones -> https://php.ac.cn/manual/en/timezones.php
                'timezone' => 'America/Chihuahua',
                'title' => "Elon Musk",
                'description' => 'Elon Reeve Musk FRS is a business magnate, industrial designer, engineer, and philanthropist. He is the founder, CEO, CTO and chief designer of SpaceX; early investor, CEO and product architect of Tesla, Inc.<br>For more information, please visit our website <a href="https://en.wikipedia.org/wiki/Elon_Musk">here</a>.',
            ]
        );
        
        echo $calendarLinks->google; // https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20200929...
        echo $calendarLinks->ics; // data:text/calendar;charset=utf8;base64,QkVHSU46VkNBTEVOREFS...
        echo $calendarLinks->yahoo; // https://calendar.yahoo.com/?v=60&view=d&type=20&st=202009...
        echo $calendarLinks->webOutlook; // https://outlook.live.com/calendar/deeplink/compose?path=/calendar/action/compos...

PHPSandbox Notebook

#28ed5d 免责声明

此仓库主要用于教育目的。作者与Spatie或任何其他相关平台无关联