Skip to content

MelisEngine

The page/data engine that powers Melis rendering — page tree, page data, sites, languages, templating-plugin base class and the cache system. Package melisplatform/melis-engine.

Purpose

MelisEngine is the read/write data layer that sits between the MelisCms backoffice and the MelisFront display engine. It resolves a page id into its full data (tree, languages, SEO, template, styles), builds page links and breadcrumbs, exposes the site / language / domain catalogue, ships the base class every front-office templating plugin extends (MelisTemplatingPlugin), and provides the multi-layer cache used during rendering. See Build a site for the end-to-end flow.

Enable it

MelisEngine is a standard Laminas module. It is listed in config/melis.module.load.php between MelisFront and the CMS content modules:

php
// config/melis.module.load.php
'MelisCms',
'MelisFront',
'MelisEngine',

It requires melisplatform/melis-core and melisplatform/melis-front (see composer.json), and it brings in laminas/laminas-cache with the Filesystem + Memory storage adapters.

Key services

Registered as service_manager aliases in config/module.config.php. The most used:

Service aliasRole
MelisEnginePage / MelisPageServicePage data: getDatasPage($idPage, $type), getPageById(), getPageLanguageList(), searchPage(), updatePageById(). $type is published or saved.
MelisEngineTree / MelisTreeServicePage tree & links: getPageChildren(), getPageFather(), getPageBreadcrumb(), getPageLink(), getHomePageLink(), getSiteByPageId(), getDomainByPageId(), getFullDatasPage().
MelisEngineSiteServiceSite catalogue: getSiteById(), getSiteDataByDomain(), getHomePageBySiteIdAndLangId(), getSiteDNDRenderMode() (drag-drop render mode).
MelisEngineLang / MelisEngineLangServiceLanguages: getAvailableLanguages(), getSiteLanguage(), getLocaleByLangId(), getLangByLocale().
MelisEngineCacheSystemThe render cache: getCacheByKey(), setCacheByKey(), deleteCacheByPrefix(), getRenderMode(), isCacheConfActive().
MelisEngineTemplateServiceResolves a template by id: getTemplate($tplId).
MelisEngineSEOServicePage SEO data: getSEOById($seoId).
MelisSearchFull-text indexing/search over pages: createIndex(), search(), clearIndex(), optimizeIndex().
MelisEngineSendMailSends emails (sendEmail(...)) using the engine email layout.
MelisEngineSiteDomainServicePer-environment site domain resolution.
MelisEnginePageDefaultUrlsServiceDefault/canonical page URLs.
MelisGdprService / MelisGdprAutoDeleteServiceGDPR consent banner texts and auto-delete of stored personal data.
MelisEngineComposerComposer helper used by the module setup controllers.

The Model/Tables/* classes are also aliased (e.g. MelisEngineTablePageTree, MelisEngineTableSite, MelisEngineTablePagePublished) for direct table-gateway access.

Backoffice

MelisEngine has no end-user tool tree of its own. It exposes a setup/maintenance controller, MelisEngine\Controller\MelisSetup (route /melis/MelisEngine, action setup-form), plus post-download / post-update setup controllers used by the installer and updater. It also registers two form-element factories used elsewhere in the backoffice: MelisEnginePluginTemplateSelect and MelisEngineSiteSelect.

Front office

The class most modules build on lives here:

ItemName
Templating-plugin base classMelisEngine\Controller\Plugin\MelisTemplatingPlugin — abstract front(), plus back(), render(), createOptionsForms(), loadDbXmlToPluginConfig(), savePluginConfigToXml().

Every front templating plugin (MelisCmsSlider, MelisCmsNews, …) extends this class — see Plugins. The module also provides the engine layout (layout/layoutEngine), the email layout (MelisEngine/emailLayout) and the default no-template / container plugin views, and the cache configurations (engine_file_cache, engine_memory_cache, meliscms_page, engine_page_services, templating_plugins) consumed by MelisEngineCacheSystem.

Two listeners expose the page/tree services over the platform micro-service layer (MelisEngineMicroServicePageServiceListener, MelisEngineTreeServiceMicroServiceListener); the exposed methods are declared in config/app.microservice.php.

Database tables

MelisEngine owns the core CMS page/site schema (created from install/sql/setup_structure.sql and the install/dbdeploy/*.sql deltas):

AreaTables
Pagesmelis_cms_page_tree, melis_cms_page_lang, melis_cms_page_published, melis_cms_page_saved, melis_cms_page_seo, melis_cms_page_style, melis_cms_page_default_urls
Sitesmelis_cms_site, melis_cms_site_domain, melis_cms_site_home, melis_cms_site_langs, melis_cms_site_config, melis_cms_site_bundle, melis_cms_site_301, melis_cms_site_404
Languages / i18nmelis_cms_lang, melis_site_translation, melis_site_translation_text
Templates / stylesmelis_cms_template, melis_cms_style, melis_cms_mini_tpl_category, melis_cms_mini_tpl_category_trans, melis_cms_mini_tpl_category_template, melis_cms_mini_tpl_site_category, melis_cms_mini_tpl_flagged_template
Platform / GDPRmelis_cms_platform_ids, melis_cms_gdpr_texts

Example

Resolve a page and build its public link from any service-aware context:

php
$pageSvc = $this->getServiceManager()->get('MelisEnginePage');
$treeSvc = $this->getServiceManager()->get('MelisEngineTree');

$page = $pageSvc->getDatasPage($idPage, 'published');   // full published page data
$url  = $treeSvc->getPageLink($idPage, true);           // absolute URL
$crumb = $treeSvc->getPageBreadcrumb($idPage);          // breadcrumb trail

Key files

ConcernPath
Module config (services, routes, caches)vendor/melisplatform/melis-engine/config/module.config.php
Micro-service exposurevendor/melisplatform/melis-engine/config/app.microservice.php
Page data servicevendor/melisplatform/melis-engine/src/Service/MelisPageService.php
Tree / links servicevendor/melisplatform/melis-engine/src/Service/MelisTreeService.php
Cache systemvendor/melisplatform/melis-engine/src/Service/MelisEngineCacheSystemService.php
Templating-plugin base classvendor/melisplatform/melis-engine/src/Controller/Plugin/MelisTemplatingPlugin.php
Table gatewaysvendor/melisplatform/melis-engine/src/Model/Tables/
Schema + deltasvendor/melisplatform/melis-engine/install/sql/, install/dbdeploy/