Monday, 6 January 2014

Zend Framework 2 configuration.

module/[module]/Module.php

  • What is it?
    Zend Framework 2 has a ModuleManager. This will look for Module.php in the root of the module directory (module/[module]) and expect to find a class called [module]\Module (see below) within it. That is, the classes within a given module will have the namespace of the module’s name, which is the directory name of the module.
  • Why do we need it?
    This is how Zend Framework 2 discoveres the configuration for a module.

module/[module]/config/Module.config.php

  • What is it?
    This is a configuration file for the module referenced from Module.php above.
    The config information is passed to the relevant components by the ServiceManager. We need two initial sections: controllers and view_manager.
  • Why do we need it?
    It holds the modules configuration. The controllers section provides a list of all the controllers provided by the module.

 config/application.config.php


  • What is it?
    This file holds the applications configuration, lists the different modules.

No comments:

Post a Comment