PHPackages                             melisplatform/melis-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. melisplatform/melis-core

ActiveMelisplatform-module

melisplatform/melis-core
========================

Melis Platform Core module

v5.3.28(3d ago)88.4k—0%4[1 PRs](https://github.com/melisplatform/melis-core/pulls)16OSL-3.0JavaScriptPHP ^8.1|^8.3CI failing

Since May 30Pushed 3d ago8 watchersCompare

[ Source](https://github.com/melisplatform/melis-core)[ Packagist](https://packagist.org/packages/melisplatform/melis-core)[ Docs](https://github.com/melisplatform/melis-core)[ RSS](/packages/melisplatform-melis-core/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (29)Versions (244)Used By (16)Security (1)

melis-core
==========

[](#melis-core)

MelisCore provides a full back-office platform, ready to use and accepting plenty of modules to run on top of it.

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running on your machine.

### Prerequisites

[](#prerequisites)

You will need to install melisplatform/melis-asset-manager in order to have this module running.
This will automatically be done when using composer.

### Installing

[](#installing)

Run the composer command:

```
composer require melisplatform/melis-core

```

In order to get the skeleton, run the following command and bring MelisCore, MelisCms and other modules:

```
composer create-project melisplatform/melis-cms-skeleton .

```

**[Access Melis Platform's setup video and documentation here](https://www.melistechnology.com/melistechnology/resources/download-documentation/id/17)**

### Database

[](#database)

Database model is accessible on the MySQL Workbench file:
/melis-core/install/sql/model
Database will be installed through composer and its hooks.
In case of problems, SQL files are located here:
/melis-core/install/sql

Tools &amp; Elements provided
-----------------------------

[](#tools--elements-provided)

- User Management Tool
- Login &amp; Lost Password
- Main Dashboard
- Profile
- TinyMCE Editor
- Modules Tool
- Diagnostic Tool
- Logs Tool
- Platforms Tool
- Back-Office Email Management Tool
- Back-Office Language Tool
- Microservices system
- GDPR Tool

Running the code
----------------

[](#running-the-code)

### MelisCore's interface designing

[](#meliscores-interface-designing)

Melis Platform is designed by following a recursive array that defines all rendered parts of the interface.
This recursive array can be found here:
/melis-core/config/app.interface.php
All modules that add content to the back office must implement this system and merge their configuration to the ZF2 config.

```
'plugins' => array(
	'meliscore' => array(
		'interface' => array(
			// First child of the interface with key name meliscore_header
			// This child has an absolute path of /plugins/meliscore/interface/meliscore_header
			'meliscore_header' => array(
				'conf' => array(
					'id' => 'id_meliscore_header',
					// But this child also as a relative path, easier of meliscore_header, also called melisKey
					'melisKey' => 'meliscore_header',
					'name' => 'tr_meliscore_header',
				),
				// Forward: how to generate this part by calling module/controller/action
				// This will also give back JS to be called for initializations
				'forward' => array(
					'module' => 'MelisCore',
					'controller' => 'Index',
					'action' => 'header',
					'jscallback' => '',
					'jsdatas' => array()
				),
				'interface' => array(
					// Continue recursively
				),
			),
		),
	),
),

```

**[See Full documentation on modules and interface designing here](https://www.melistechnology.com/MelisTechnology/resources/documentation/back-office/module-functions/MelisPlatformsinterfaceprinciple)**

### Reordering the children of an interface

[](#reordering-the-children-of-an-interface)

As configuration between modules are merged with each other in the module's order, it doesn't always correspond to the actual order you'd like to be displayed.
It is possible to define a specific order by creating a key 'interface\_ordering' at the root and listing children keys in a specific order:

```
'interface_ordering' => array(
    // reordering le left pannel of Melis Platform
	'meliscore_leftmenu' => array(
		'meliscore_leftmenu_identity',  // identity zone first
		'meliscore_leftmenu_dashboard', // acces to dashboard second
		'meliscms_sitetree',		// site tree 3rd
		'meliscore_toolstree',		// tools tree 4th
		'meliscore_footer',		// footer last
	),

```

### MelisCore Services

[](#meliscore-services)

MelisCore provides many services to be used in other modules.
Find them in the folder: /melis-core/src/Service

- MelisCoreConfig
    This service deals with the interface config files that generates the back-office interface.
    All files "/config/app.interface.php" from all modules are merged together to create a big configuration.
    This service will then handle it and all the specificities from MelisPlatform.
    Access to the configuration only through this service as it will run many scripts (translations, melisKey, etc).
    File: /melis-core/src/Service/MelisCoreConfigService.php

```
// Example 1
// Get the service
$melisAppConfig = $this->getServiceManager()->get('MelisCoreConfig');
// Get the subpart of the config file
$appsConfigCenter = $melisAppConfig->getItem('/meliscore/interface/meliscore_center/');

```

```
// Example 2
// Get the service
$melisMelisCoreConfig = $this->getServiceManager()->get('MelisCoreConfig');
// Get a form config, always use getFormMergedAndOrdered
$appConfigForm = $melisMelisCoreConfig->getFormMergedAndOrdered('meliscore/tools/meliscore_logs_tool/forms/meliscore_logs_tool_log_type_form','meliscore_logs_tool_log_type_form');

```

```
// Example 3
// Get the service
$melisAppConfig = $this->getServiceManager()->get('MelisCoreConfig');
// Get the "datas" part of the "meliscore" key in the config and, using getItemPerPlatform, select depending on the platform you're on
$datas = $melisAppConfig->getItemPerPlatform('/meliscore/datas');

```

- MelisCoreAuthService
    Gets the user's auth and validates authentication, extends ZF AuthenticationService File: /melis-core/src/Service/MelisCoreAuthService.php

```
// Get the service
$melisCoreAuth = $this->getServiceManager()->get('MelisCoreAuth');
// check identity
$logged = $melisCoreAuth->hasIdentity()

```

- MelisCoreRights
    Get the rights defined for the user and adapt access to the different elements of the interface:
    File: /melis-core/src/Service/MelisCoreRightsService.php

```
// Get the services
$melisCoreAuth = $this->getServiceManager()->get('MelisCoreAuth');
$melisCoreRights = $this->getServiceManager()->get('MelisCoreRights');
if($melisCoreAuth->hasIdentity())
{
	// Get the user's rights
	$xmlRights = $melisCoreAuth->getAuthRights();

	// Check if the user has an exclusion of access to /meliscore_dashboard
	$isAccessible = $melisCoreRights->isAccessible($xmlRights,
							MelisCoreRightsService::MELISCORE_PREFIX_INTERFACE,
							'/meliscore_dashboard');
}

```

**[See Full documentation on rights management system here](https://www.melistechnology.com/MelisTechnology/resources/documentation/back-office/rights-management-system/ExplanationoftheRightsWayofSavin)**

- MelisCoreFlashMessenger
    Add logs to flash messenger and get some notifications in the back office

```
$flashMessenger = $this->getServiceManager()->get('MelisCoreFlashMessenger');
$flashMessenger->addToFlashMessenger('title', 'message', $flashMessenger::WARNING);

```

- MelisCoreBOEmailService
    File: /melis-core/src/Service/MelisCoreBOEmailService.php
    Add or override emails sent from the back office to send them from your modules and manage them through a tool

```
// Get the service
$melisEmailBO = $this->getServiceManager()->get('MelisCoreBOEmailService');
// Send the mail and fills the blanks in the mail (tags), get the language version
$melisEmailBO->sendBoEmailByCode('ACCOUNTCREATION',  $tags, $email_to, $name_to, $langId);

```

**[See Full documentation on back-office emails here](https://www.melistechnology.com/MelisTechnology/resources/documentation/back-office/email-management-system/Presentationoftheemailmanagement)**

### MelisCore Forms

[](#meliscore-forms)

#### Forms factories

[](#forms-factories)

All Melis CMS forms are built using Form Factories.
All form configuration are available in the file: /melis-core/config/app.forms.php
Any module can override or add items in this form by building the keys in an array and marge it in the Module.php config creation part.

```
return array(
	'plugins' => array(

		// MelisCms array
		'meliscore' => array(

			// Form key
			'forms' => array(

				// MelisCore login form
				'meliscore_login' => array(
					'attributes' => array(
						'name' => 'meliscore_login',
						'id' => 'idformmeliscorelogin',
						'method' => 'POST',
					),
					'hydrator'  => 'Laminas\Hydrator\ArraySerializableHydrator',
					'elements' => array(
						array(
							'spec' => array(
								...
							),
						),
					),
					'input_filter' => array(
						'usr_login' => array(
							...
						),
					),
				),
			),
		),
	),
),

```

#### Forms elements

[](#forms-elements)

MelisCore provides many form elements to be used in forms:

- MelisCoreLanguageSelect: a dropdown to select a language of the platform
- MelisCoreSiteSelect: a dropdown to select a site
- MelisToggleButton: an on-off button designed for Melis Platform
- MelisText: a input field

#### Overriding / Adding / Changing order of the fields

[](#overriding--adding--changing-order-of-the-fields)

Existing forms can be updated to add new fields by simply declaring the form in your module's config and update the key for your form.
To reuse the previous example, going back to the meliscore\_login key, then adding new fields, eventually merged all together:

```
return array(
	'plugins' => array(
		// MelisCms array
		'meliscore' => array(
			// Form key
			'forms' => array(
				// MelisCore login form
				'meliscore_login' => array(
					'elements' => array(
					),
					'input_filter' => array(
					),

```

At some point, it could be a nessecity to reorder the fields for a specific project.
Declare a key 'forms\_ordering' and a subkey nammed like the form.
Then just place existing elements in the order needed. No need to place all of them, start with what is reordered and stop when it's finished, other existing form elements will automatically be added at the end.

```
return array(
	// key at the root for listing forms' order modifications
	'forms_ordering' => array(

		// change the order of the MelisCore email management form tool.
		'meliscore_emails_mngt_tool_general_properties_form' => array(
			'elements' => array(
				// Name will now be first
				array(
					'spec' => array(
						'name' => 'boe_code_name',
					),
				),
				// "From" email will be second
				array(
					'spec' => array(
						'name' => 'boe_from_email',
					),
				),

				// Rest of the form's field will come in order after
			),
		),
	),
);

```

MelisCoreConfig Service provides a method called getFormMergedAndOrdered that will get the form and give it back reordered:

```
// Get the service
$melisMelisCoreConfig = $this->getServiceManager()->get('MelisCoreConfig');
// Get a form config, always use getFormMergedAndOrdered
$appConfigForm = $melisMelisCoreConfig->getFormMergedAndOrdered('meliscore/tools/meliscore_logs_tool/forms/meliscore_logs_tool_log_type_form','meliscore_logs_tool_log_type_form');

```

### Listening to services and update behavior with custom code

[](#listening-to-services-and-update-behavior-with-custom-code)

Most services trigger events so that the behavior can be modified.

```
public function attach(EventManagerInterface $events)
{
	$sharedEvents = $events->getSharedManager();

	$callBackHandler = $sharedEvents->attach(
		'MelisCore',
		array(
			'meliscore_tooluser_save_end',
		),
		function($e){

			$sm = $e->getTarget()->getEvent()->getApplication()->getServiceManager();

    		// custom code
    	},
    100);

    $this->listeners[] = $callBackHandler;
}

```

### GDPR Tool

[](#gdpr-tool)

MelisCore provides a system to look for your user's data. By allowing other modules to plug / interact with it, and allow to see, extract, and delete the user's data.

#### Events:

[](#events-)

**melis\_core\_gdpr\_user\_info\_event** : This event will trigger after searching a user. Modules that are listening to this event will send back the data they have on the user or it will stay silent if there are none.

**melis\_core\_gdpr\_user\_extract\_event** : This event will trigger when the button "Extract Selected" button is clicked, Modules will then format and send back whatever they have for the items selected.

**melis\_core\_gdpr\_user\_delete\_event** : This event will trigger when the "Delete Selected" button is clicked. The items that are selected will then be deleted or updated by their respective modules.

#### Listening to the Events :

[](#listening-to-the-events--)

**melis\_core\_gdpr\_user\_info\_event**
The parameter of this event is the form inputs.

```
[
    'search' => [
      'user_name'  => 'Doe',
      'user_email' => 'john@doe.com,
      'site'       => 2 //siteId,
      etc ..,
    ],
]

```

You can have your own logic for this event as long as you will follow this structure for the value that will be returned.

```
[
    'results' => [
      'MelisCmsProspects' => [...],
      'MelisCmsNewsletters' => [...],
      'YourModule' => [...],
    ]
]

```

```
[
    'results' => [
        'YourModule' => [
            'icon' => '...', //icon that will be displayed
            'moduleName' => 'YourModule', //text that will be displayed
            'values' => [
            ...
            ],
        ],
    ],
]

```

```
'values' => [
    'columns' => [
        //IDs and checkbox will be provided already in the table
        'name' => [
           'id' => 'meliscmsprospects_col_name',
           'text' => 'Name'
        ],
        'email' => [
           'id' => 'meliscmsprospects_col_email',
           'text' => 'Email'
        ],
        'date' => [
           'id' => 'meliscmsprospects_col_date',
           'text' => 'Date'
        ],
    ],
    'datas' => [
        //The keys are the IDs of the items (13, 15)
        '13' => [
           'name' => 'Doe',
           'email' => 'Doe@John.com'
           'date' => 11/13/2017 13:13:00
        ],
        '15' => [
           'name' => 'Doe',
           'email' => 'Doe@John2.com'
           'date' => 11/15/2017 15:15:00
        ],
    ],
]

```

The columns index is the columns that will be shown in the table. while the datas index is the rows on the table.

**melis\_core\_gdpr\_user\_extract\_event**
The parameter of this event are the modules containing the selected ids that will be extracted.

```
[
    'selected' => [
      'MelisCmsProspects'  => [13,15],
      'MelisCmsNewsletter' => [2],
    ]
]

```

The modules that will catch the event will then provide their own results using this structure.

```
[
    'results' => [
      'MelisCmsProspects'  => '...',
      'MelisCmsNewsletter' => '...',
      'yourModule' => '...';
    ],
]

```

**melis\_core\_gdpr\_user\_delete\_event**
The parameter of this event are the list of modules containing all the Ids that are selected.

```
[
    'selected' => [
        'MelisCmsProspects'  => [13,15],
        'MelisCmsNewsletter' => '[2],
    ],
]

```

The modules that will catch the event will then return an acknowledgement message if the items are succesfully deleted.

```
[
    'results' => [
        'MelisCmsProspects'  => true,
        'MelisCmsNewsletter' => true,
    ],
]

```

### Javascript helpers provided with MelisCore

[](#javascript-helpers-provided-with-meliscore)

#### Melis Helpers

[](#melis-helpers)

Most helpers are located in the file:
/melis-core/public/js/core/melisHelper.js

- zoneReload: Reloads an html zone using the MelisKey and an ajax call
- createModal: Creates a modal and put a template inside
- melisOkNotification: generates a green notification
- melisKoNotification: generates a red notification
- tabSwitch: switches the main tabs
- tabClose: closes a tab
- tabOpen: opens a tab
- loadingZone: wraps a div in a loading design
- removeLoadingZone: removes the loading design

**[See Full documentation on Melis JS helpers here](https://www.melistechnology.com/MelisTechnology/resources/documentation/back-office/module-functions/ZoneReloadHelper)**

#### TinyMCE and configurations

[](#tinymce-and-configurations)

MelisCore brings TinyMCE as its editor and has one configuration.
TinyMCE helper is located here:
/melis-core/public/js/tinyMCE/melis\_tinymce.js

```
// Creating a tinyMCE zone with config "tool" on the selected item and overriding some parameters from conf
melisTinyMCE.createTinyMCE("tool", selector, {height: 200, relative_urls: false});

```

Configurations:

- tool: the default config for tools that use html editor
    Creating other config is possible. Add the config in a file then declare the file in the module.config.php file of the module:

```
// Config Files
'tinyMCE' => array(
	'html' => 'MelisCore/public/js/tinyMCE/tool.php',
),

```

**[See Full documentation on TinyMCE and Melis Platform here](https://www.melistechnology.com/MelisTechnology/resources/documentation/back-office/configuration-of-tinymce/Configurationfilesoverview)**

\####Cache and Bundle Cache

- Caching system is already applied in Melis platform BO, particularly in leftmenu, dashboard, dashboard plugins menu and front plugins menu.
- Clearing the cache will be done automatically by updating the user or updating the modules in module tool.
- You can also disable the caching system inside platform tool.

Bundle

- Melis platform improved its bundling system by loading one file instead of every file in each module.
- You can re-bundle all assets inside the Module tool.
- To disable/enable bundle per platform, you can override it inside the MelisModuleConfig interface:

```
'development' => [
    'build_bundle' => false,
],
'preprod' => [
    'build_bundle' => true,
],
'prod' => [
    'build_bundle' => true,
]

```

Authors
-------

[](#authors)

- **Melis Technology** - [www.melistechnology.com](https://www.melistechnology.com/)

See also the list of [contributors](https://github.com/melisplatform/melis-core/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the OSL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance99

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity98

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Recently: every ~17 days

Total

145

Last Release

3d ago

Major Versions

v2.5.0 → v3.0.02018-10-17

v3.2.13 → v4.0.02020-08-17

v4.1.3 → v5.0.02022-06-20

PHP version history (5 changes)v2.1PHP ^5.5 || ^7.0

v3.0.1PHP ^7.0

v4.0.0PHP ^7.1.3|^7.2|^7.3

v5.0.0PHP ^7.3|^8.0

v5.1.0PHP ^8.1|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8c3d1de854682cd37de2faa73a026b1c83b4b15500f352077581948c5d778ce?d=identicon)[melisplatform](/maintainers/melisplatform)

---

Top Contributors

[![jzabate](https://avatars.githubusercontent.com/u/39899634?v=4)](https://github.com/jzabate "jzabate (760 commits)")[![rbbrioso28](https://avatars.githubusercontent.com/u/9497212?v=4)](https://github.com/rbbrioso28 "rbbrioso28 (437 commits)")[![benborla](https://avatars.githubusercontent.com/u/22745294?v=4)](https://github.com/benborla "benborla (281 commits)")[![sircxes](https://avatars.githubusercontent.com/u/21098160?v=4)](https://github.com/sircxes "sircxes (256 commits)")[![fparan](https://avatars.githubusercontent.com/u/39509647?v=4)](https://github.com/fparan "fparan (161 commits)")[![simonalcover](https://avatars.githubusercontent.com/u/17284664?v=4)](https://github.com/simonalcover "simonalcover (105 commits)")[![jun1432](https://avatars.githubusercontent.com/u/26325630?v=4)](https://github.com/jun1432 "jun1432 (105 commits)")[![jamesrepository](https://avatars.githubusercontent.com/u/10151213?v=4)](https://github.com/jamesrepository "jamesrepository (101 commits)")[![mariateresapomar](https://avatars.githubusercontent.com/u/85868605?v=4)](https://github.com/mariateresapomar "mariateresapomar (73 commits)")[![wongandy](https://avatars.githubusercontent.com/u/3273498?v=4)](https://github.com/wongandy "wongandy (54 commits)")[![ksuson](https://avatars.githubusercontent.com/u/31838758?v=4)](https://github.com/ksuson "ksuson (51 commits)")[![sgris](https://avatars.githubusercontent.com/u/3981660?v=4)](https://github.com/sgris "sgris (34 commits)")[![nicole-cayambas](https://avatars.githubusercontent.com/u/55810654?v=4)](https://github.com/nicole-cayambas "nicole-cayambas (10 commits)")[![ianborla](https://avatars.githubusercontent.com/u/4855907?v=4)](https://github.com/ianborla "ianborla (4 commits)")[![jerremeirago](https://avatars.githubusercontent.com/u/30467695?v=4)](https://github.com/jerremeirago "jerremeirago (3 commits)")[![srennou](https://avatars.githubusercontent.com/u/63244877?v=4)](https://github.com/srennou "srennou (2 commits)")[![Victor-melis1224](https://avatars.githubusercontent.com/u/30471257?v=4)](https://github.com/Victor-melis1224 "Victor-melis1224 (2 commits)")

---

Tags

cmsmodulezf2melis

### Embed Badge

![Health badge](/badges/melisplatform-melis-core/health.svg)

```
[![Health](https://phpackages.com/badges/melisplatform-melis-core/health.svg)](https://phpackages.com/packages/melisplatform-melis-core)
```

###  Alternatives

[doctrine/doctrine-module

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

4037.8M107](/packages/doctrine-doctrine-module)[lm-commons/lmc-user

A generic user registration and authentication module for Laminas. Supports Laminas\\Db and Doctrine2.

1878.2k3](/packages/lm-commons-lmc-user)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
