PHP code example of melisplatform / melis-cms

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

 
return array(
	'plugins' => array(
	
		// MelisCms array
		'meliscms' => array(
		
			// Form key
			'forms' => array(
			
				// MelisCms Page Properties form
				'meliscms_page_properties' => array(
					'attributes' => array(
						'name' => 'pageproperties',
						'id' => 'idformpageproperties',
						'method' => 'POST',
						'action' => '/melis/MelisCms/Page/saveProperties',
					),
					'hydrator'  => 'Laminas\Hydrator\ArraySerializable',
					'elements' => array(  
						array(
							'spec' => array(
								...
							),
						),
					),
					'input_filter' => array(      
						'page_id' => array(
							...
						),   
					),
				),
			),
		),
	),
),
  
public function attach(EventManagerInterface $events)
{
    $sharedEvents      = $events->getSharedManager();
    
    $callBackHandler = $sharedEvents->attach(
    	'MelisCms',
    	array(
    		'meliscms_page_save_start',
    		'meliscms_page_publish_start',
    	),
    	function($e){

    		$sm = $e->getTarget()->getEvent()->getApplication()->getServiceManager();
    		
    		// Custom Code here
    	},
    100);
    
    $this->listeners[] = $callBackHandler;
}
  
// Config Files  
'tinyMCE' => array(  
	'html' => 'MelisCms/public/js/tinyMCE/html.php',  
	'textarea' => 'MelisCms/public/js/tinyMCE/textarea.php',  
	'media' => 'MelisCms/public/js/tinyMCE/media.php',  
),