Skip to content

sedpro/configInitializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

configInitializer

Several files enabling config initialization in zf2

Use

Add Config folder to module/Application/src/Application

In file module.config.php add this initializer:

  'service_manager' => [
    'initializers' => [
        'Application\Config\ConfigAwareInterfaceInitializer',
    ],
    ...
  ],

Any class in namespace Application\Service can now implement \Application\Config\ConfigAwareInterface interface. You can use trait \Application\Config\ConfigAware:

  class SimpleService implements \Application\Config\ConfigAwareInterface
  {
    use \Application\Config\ConfigAware;
    ...

You can now get your application config from this class:

  $config = $this->getConfig();

PROFIT!!!

About

Several files enabling config initialization in zf2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages