承接 jsvrcek/ics-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jsvrcek/ics-bundle

最新稳定版本:1.2

Composer 安装命令:

composer require jsvrcek/ics-bundle

包简介

This bundle provides a dependency injection wrapper for the JsvrcekICS iCal library

README 文档

README

Symfony Bundle providing dependency injection for the Jsvrcek\ICS library, which is for creating iCal .ics files.

Installation

composer req jsvrcek/ics-bundle

Usage

    namespace App\Services;

    use Jsvrcek\ICS\CalendarExport;
    use Jsvrcek\ICS\Model\Calendar;
    use Jsvrcek\ICS\Model\CalendarEvent;
    use Jsvrcek\ICS\Model\Relationship\Attendee;
    use Jsvrcek\ICS\Utility\Formatter;

    private Formatter $formatter;
    private CalendarExport $calendarExport;

    class MyService
    {

    public function __construct(Formatter $formatter, CalendarExport $calendarExport) {

        $this->formatter = $formatter;
        $this->calendarExport = $calendarExport;
    }
// or inject them into the controller
        public function calendarAction(Formatter $formatter, CalendarExport $calendarExport)
        {
            $eventOne = new CalendarEvent();
            $eventOne->setStart(new \DateTime())
                ->setSummary('Family reunion')
                ->setUid('event-uid');

            //add an Attendee
            $attendee = new Attendee($formatter);
            $attendee->setValue('moe@example.com')
                ->setName('Moe Smith');
            $eventOne->addAttendee($attendee);

            // Add event to CalendarExport
            $calendarExport->setCalendars( [
                (new Calendar)->setTimezone( new DateTimeZone(date_default_timezone_get()) )
                    ->addEvent( $eventOne )
            ] );
            
            $response = new Response($calendarExport->getStream());
            $response->headers->set('Content-Type', 'text/calendar');
            
            return $response;
        }
    }

统计信息

  • 总下载量: 142.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-25