melisplatform / melis-platform-framework-silex
A Silex framework dependecy to for running silex inside Melis Platform
Installs: 110
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 0
Type:melisplatform-module
Requires
- doctrine/dbal: ~2.2
- melisplatform/melis-platform-frameworks: ^3.2
- silex/silex: ~2.0
- silex/web-profiler: ~2.0
- symfony/asset: ^4.4
- symfony/browser-kit: ^4.4
- symfony/class-loader: ^3.4
- symfony/config: ^4.4
- symfony/css-selector: ^4.4
- symfony/debug: ^4.4
- symfony/form: ^4.4
- symfony/monolog-bridge: ^4.4
- symfony/security: ^4.4
- symfony/translation: ^4.4
- symfony/twig-bridge: ^3.0
- symfony/validator: ^4.4
- twig/twig: ^2.11
This package is auto-updated.
Last update: 2024-12-19 16:15:47 UTC
README
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.
Prerequisites
This module requires melisplatform/melis-core and silex/silex in order to have this module running. This will automatically be done when using composer.
Installing
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());
Usage
Example of using the MelisServiceProvider in Silex framework.
$melisNewsService = $app['melis.services']->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.
/_docroot_/vendor/melisplatform/
- 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(
//services
'MelisCmsNewsService' => 'MelisCmsNews\Service\Factory\MelisCmsNewsServiceFactory',
//tables
'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['melis.services']->getService("MelisCmsNewsService");