\PhalApi_Config

Config Interface

Get all configurations of project.


Usage:

// Assume we have the app.php config file as below:
return array(
 'version' => '1.1.1',

 'email' => array(
     'address' => 'chanzonghuang@gmail.com',
  );
);

// We can get the config like:
// get all configs in app.php
DI()->config->get('app');

// or one config in app.php
DI()->config->get('app.version');  // return: 1.1.1

// or multi config in app.php
DI()->config->get('app.version.address');  // return: chanzonghuang@gmail.com

Summary

Methods
Constants
get()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

get()

get(  $key, mixed  $default = NULL) : mixed

Get config

Parameters

$key

string config key

mixed $default

config default value

Returns

mixed —

config value, or return $default when config not exists