PHP code example of melisplatform / melis-calendar

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

    

melisplatform / melis-calendar example snippets


$calendarService  = $this->getServiceManager()->get('MelisCalendarService');

return array(
	'plugins' => array(

		// meliscalendar array
		'meliscalendar' => array(

			// Form key
			'forms' => array(

				// MelisCalendar Event Form form
				'melicalendar_event_form' => array(
					'attributes' => array(
						'name' => 'calendarform',
						'id' => 'idformcalendar',
						'method' => 'POST',
						'action' => '/melis/MelisCalendar/ToolCalendar/addEvent',
					),
					'hydrator'  => 'Laminas\Hydrator\ArraySerializable',
					'elements' => array(
						array(
							'spec' => array(
									...
							),
						),
					),
					'input_filter' => array(
						'cal_event_title' => array(
								...
						),
					),
				),
			),
		),
	),
),

$callBackHandler = $sharedEvents->attach(
	'MelisCalendar',
	array(
	    'meliscalendar_save_event_end',
	),
	function($e){
		$sm = $e->getTarget()->getServiceManager();

		// Get parameters
		$params = $e->getParams();

		// Code here
	},
10);