เมื่อใช้แพ็คเกจนี้ คุณสามารถสร้างลิงก์เพื่อเพิ่มกิจกรรมลงในระบบปฏิทินได้ นี่เป็นตัวอย่างสั้นๆ:
use Spatie CalendarLinks Link ;
Link:: create (
' Birthday ' ,
DateTime:: createFromFormat ( ' Y-m-d H:i ' , ' 2018-02-01 09:00 ' ),
DateTime:: createFromFormat ( ' Y-m-d H:i ' , ' 2018-02-01 18:00 ' )
)-> google ();
ผลลัพธ์ที่ได้จะออกมา: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Birthday&dates=20180201T090000/20180201T180000&sprop=&sprop=name:
หากคุณไปที่ลิงก์นั้น (และได้รับการตรวจสอบสิทธิ์จาก Google) คุณจะเห็นหน้าจอสำหรับเพิ่มกิจกรรมลงในปฏิทินของคุณ
แพ็คเกจนี้ยังสามารถสร้างไฟล์ ics ที่คุณสามารถเปิดในโปรแกรมอีเมลและปฏิทินหลายโปรแกรม รวมถึง Microsoft Outlook, Google Calendar และ Apple Calendar
เราลงทุนทรัพยากรจำนวนมากเพื่อสร้างแพ็คเกจโอเพ่นซอร์สที่ดีที่สุดในระดับเดียวกัน คุณสามารถสนับสนุนเราได้โดยการซื้อหนึ่งในผลิตภัณฑ์ที่ต้องชำระเงินของเรา
เราขอขอบคุณอย่างยิ่งที่คุณส่งโปสการ์ดจากบ้านเกิดของคุณถึงเรา โดยระบุว่าคุณใช้แพ็คเกจใดของเรา คุณจะพบที่อยู่ของเราในหน้าติดต่อของเรา เราเผยแพร่โปสการ์ดที่ได้รับทั้งหมดบนวอลล์โปสการ์ดเสมือนของเรา
คุณสามารถติดตั้งแพ็คเกจผ่านทางผู้แต่ง:
composer require spatie/calendar-links
<?php
use Spatie CalendarLinks Link ;
$ from = DateTime:: createFromFormat ( ' Y-m-d H:i ' , ' 2018-02-01 09:00 ' );
$ to = DateTime:: createFromFormat ( ' Y-m-d H:i ' , ' 2018-02-01 18:00 ' );
$ link = Link:: create ( ' Sebastian’s birthday ' , $ from , $ to )
-> description ( ' Cookies & cocktails! ' )
-> address ( ' Kruikstraat 22, 2018 Antwerpen ' );
// Generate a link to create an event on Google calendar
echo $ link -> google ();
// Generate a link to create an event on Yahoo calendar
echo $ link -> yahoo ();
// Generate a link to create an event on outlook . live . com calendar
echo $ link -> webOutlook ();
// Generate a link to create an event on outlook . office . com calendar
echo $ link -> webOffice ();
// Generate a data URI for an ics file ( for iCal & Outlook )
echo $ link -> ics ();
echo $ link -> ics ([ ' UID ' => ' custom-id ' ]); // Custom UID ( to update existing events )
echo $ link -> ics ([ ' URL ' => ' https://my-page.com ' ]); // Custom URL
echo $ link -> ics ([ ' REMINDER ' => []]); // Add the default reminder ( for iCal & Outlook )
echo $ link -> ics ([ ' REMINDER ' => [ ' DESCRIPTION ' => ' Remind me ' , ' TIME ' => new DateTime ( ' tomorrow 12:30 UTC ' )]]); // Add a custom reminder
echo $ link -> ics ([], [ ' format ' => ' file ' ]); // use file output ; e . g . to attach ics as a file to an email .
// Generate a data URI using arbitrary generator :
echo $ link -> formatWith ( new Your Generator ());
Link
ทั้งหมดควรได้รับการสนับสนุนโดยตัวสร้างอย่างน้อย 2 ตัว (บริการที่แตกต่างกันมีคุณสมบัติที่แตกต่างกัน) โปรดดู CHANGELOG สำหรับข้อมูลเพิ่มเติม
composer test
โปรดดูการมีส่วนร่วมเพื่อดูรายละเอียด
หากคุณพบข้อบกพร่องเกี่ยวกับความปลอดภัย โปรดส่งอีเมลมาที่ [email protected] แทนการใช้ตัวติดตามปัญหา
คุณสามารถใช้แพ็คเกจนี้ได้ฟรี (ได้รับใบอนุญาตจาก MIT) แต่ถ้าเหมาะกับสภาพแวดล้อมการใช้งานจริงของคุณ เราขอขอบคุณอย่างยิ่งที่คุณส่งโปสการ์ดจากบ้านเกิดของคุณมาให้เรา โดยระบุแพ็คเกจที่คุณใช้อยู่
ที่อยู่ของเราคือ: Spatie, Samberstraat 69D, 2060 Antwerp, เบลเยียม
เราเผยแพร่ไปรษณียบัตรที่ได้รับทั้งหมดบนเว็บไซต์ของบริษัทของเรา
ใบอนุญาตเอ็มไอที (MIT) โปรดดูไฟล์ใบอนุญาตสำหรับข้อมูลเพิ่มเติม