PHP code example of wisembly / calendart

1. Go to this page and download the library: Download wisembly/calendart 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/ */

    

wisembly / calendart example snippets




use CalendArt\Adapter\Google\GoogleAdapter,
    CalendArt\Adapter\Google\Util\OAuth2Token;

$oauth = new OAuth2Token('your-oauth2-token', 'Bearer', 3600); // You can get a OAuth2 token on google's oauth playground
$adapter = new GoogleAdapter($oauth);

$primary = $adapter->getCalendarApi()->get('primary'); // there is always a "primary" calendar on Google
$event   = $adapter->getEventApi($primary)->getList();

var_dump($primary); // Should dump a Calendar instance, with its hydrated events