A Silex framework dependecy to for running silex inside Melis Platform

v3.2.0 2020-02-07 05:01 UTC


This module runs the Silex micro-framework inside Melis Platform.
The melis-platform-framework silex contains a Silex Service Provider to let Silex use Melis services available.

Getting Started

These instructions will guide you to run the Silex micro-framework inside Melis Platform.


This module requires melisplatform/melis-core and silex/silex in order to have this module running. This will automatically be done when using composer.


composer require melisplatform/melis-platform-framework-silex

Service Providers

In order to load and use a service provider, you must register the service provider in the Silex application which is commonly located in /Silex/src/app.php

use MelisPlatformFrameworkSilex\Provider\MelisServiceProvider;

$app = new Silex\Application();

$app->register(new MelisServiceProvider());


Example of using the MelisServiceProvider in Silex framework.

$melisNewsService = $app['']->getService("MelisCmsNewsService");
$news = $melisNewsService->getNewsList();

Where to find Melis Services

  • Melis Services are found inside each Melis Modules and these melis modules can be found by following the path below.
  • Inside each Melis Module you can find module.config.php in the config folder.
    The module.config.php contains an array keys called aliases and factories under service_manager.
'service_manager' => array(
    'invokables' => array(
    'aliases' => array(
        'translator' => 'MvcTranslator',
        'MelisCmsNewsTable' => 'MelisCmsNews\Model\Tables\MelisCmsNewsTable',
        'MelisCmsNewsTextsTable' => 'MelisCmsNews\Model\Tables\MelisCmsNewsTextsTable',
    'factories' => array(
        'MelisCmsNewsService' => 'MelisCmsNews\Service\Factory\MelisCmsNewsServiceFactory',
        'MelisCmsNews\Model\Tables\MelisCmsNewsTable' => 'MelisCmsNews\Model\Tables\Factory\MelisCmsNewsTableFactory',
        'MelisCmsNews\Model\Tables\MelisCmsNewsTextsTable' => 'MelisCmsNews\Model\Tables\Factory\MelisCmsNewsTextsTableFactory',
  • The array keys inside aliases or factories can be called in Selix using the MelisServiceProvider.
$melisNewsSvc = $app['']->getService("MelisCmsNewsService");