2017-07-21 19:59:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The configuration provider for the App module
|
|
|
|
|
*
|
|
|
|
|
* @see https://docs.zendframework.com/zend-component-installer/
|
|
|
|
|
*/
|
|
|
|
|
class ConfigProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Returns the configuration array
|
|
|
|
|
*
|
|
|
|
|
* To add a bit of a structure, each section is defined in a separate
|
|
|
|
|
* method which returns an array with its configuration.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function __invoke()
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'dependencies' => $this->getDependencies(),
|
|
|
|
|
'templates' => $this->getTemplates(),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the container dependencies
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function getDependencies()
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'invokables' => [
|
2017-07-21 20:26:13 +02:00
|
|
|
Service\GalleryService::class => Service\GalleryService::class,
|
|
|
|
|
Action\HomePageAction::class => Action\HomePageAction::class,
|
2017-07-21 19:59:16 +02:00
|
|
|
],
|
|
|
|
|
'factories' => [
|
|
|
|
|
Action\ListGalleriesAction::class => Action\ListGalleriesFactory::class,
|
|
|
|
|
Action\GetGalleryImagesAction::class => Action\GetGalleryImagesFactory::class,
|
|
|
|
|
Action\GetImageAction::class => Action\GetImageFactory::class,
|
|
|
|
|
],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the templates configuration
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function getTemplates()
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'paths' => [
|
|
|
|
|
'app' => ['templates/app'],
|
|
|
|
|
'error' => ['templates/error'],
|
|
|
|
|
'layout' => ['templates/layout'],
|
|
|
|
|
],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|