Skip to content

Commit

Permalink
fixed configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gabbydgab committed Jun 8, 2016
1 parent 0feee9d commit 5da3571
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/dependencies.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
* @see https://zendframework.github.io/zend-servicemanager/configuring-the-service-manager/
*/

use AimWorld\Factory;

return [
'factories' => [],
'factories' => [
"AimWorld\Options\ModuleOptions" => Factory\ModuleOptionsFactory::class,
],
'services' => [],
'abstract_factories' => [],
'delegators' => [],
Expand Down
13 changes: 13 additions & 0 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ class Module
{
private $config = [];

public function onBootstrap(MvcEvent $event)
{
$app = $event->getApplication();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($app->getEventManager());

$seviceManager = $app->getServiceManager();
$variables = $seviceManager->get("AimWorld\Options\ModuleOptions");

$viewModel = $event->getViewModel();
$viewModel->setVariables($variables->toArray());
}

/**
* Return default configuration for zend-mvc applications.
*/
Expand Down

0 comments on commit 5da3571

Please sign in to comment.