PHP code example of solution10 / calendar

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

    

solution10 / calendar example snippets



// Creates a calendar, using today as a starting point.
$calendar = new Solution10\Calendar\Calendar(new DateTime('now'));

// We now need to give the calendar a "resolution". This tells the
// Calendar whether we're showing a month view, or a Week, or maybe
// even a whole year. Let's start with a Month:

$calendar->setResolution(new MonthResolution());

// That's it! Let's grab the view data and render:
$viewData = $calendar->viewData();
$months = $viewData['contents'];