Zend\Mvc\Application::getConfig PHP Méthode

getConfig() public méthode

Retrieve the application configuration
public getConfig ( ) : array | object
Résultat array | object
    public function getConfig()
    {
        return $this->serviceManager->get('config');
    }

Usage Example

 /**
  * Collects init params configuration from multiple sources
  *
  * Each next step overwrites previous, whenever data is available, in the following order:
  * 1: ZF application config
  * 2: environment
  * 3: CLI parameters (if the application is running in CLI mode)
  *
  * @param Application $application
  * @return array
  */
 private function extractInitParameters(Application $application)
 {
     $result = [];
     $config = $application->getConfig();
     if (isset($config[self::BOOTSTRAP_PARAM])) {
         $result = $config[self::BOOTSTRAP_PARAM];
     }
     foreach ([State::PARAM_MODE, AppBootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] as $initKey) {
         if (isset($_SERVER[$initKey])) {
             $result[$initKey] = $_SERVER[$initKey];
         }
     }
     $result = array_replace_recursive($result, $this->extractFromCli($application->getRequest()));
     return $result;
 }
All Usage Examples Of Zend\Mvc\Application::getConfig