PHP code example of wts-calendar / server-php

1. Go to this page and download the library: Download wts-calendar/server-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wts-calendar / server-php example snippets




use WtsCalendar\Server\CalendarApiHandler;
use WtsCalendar\Server\CalendarApiOptions;
use WtsCalendar\Server\CalendarEventStoreInterface;

$handler = new CalendarApiHandler(
    $container->get(CalendarEventStoreInterface::class),
    $container->get(Psr\Http\Message\ResponseFactoryInterface::class),
    $container->get(Psr\Http\Message\StreamFactoryInterface::class),
    new CalendarApiOptions(
        

$app->map(
    ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'],
    '/api/calendar/events[/{id}]',
    $handler,
);
bash
composer