src/Utils/ArrayDot.php
public function get($key, $defaultValue = null)
    {
        $keys = explode('.', $key);
        $config = $this->_arr;

        foreach ($keys as $value) {
            if (is_array($config)) {
                if (array_key_exists($value, $config)) {
                    $config = $config[$value];
                } else {
                    return $defaultValue;
                }
            } else {
                return $defaultValue;
            }
        }

        return $config;
    }
public function get($key, $defaultValue = null)
    {
        $keys = explode('.', $key);
        $config = $this->_arr;

        foreach ($keys as $value) {
            if (is_array($config)) {
                if (array_key_exists($value, $config)) {
                    $config = $config[$value];
                } else {
                    return $defaultValue;
                }
            } else {
                return $defaultValue;
            }
        }

        return $config;
    }
public function get ( $ key , $ defaultValue = null ) { $ keys = explode ( '.' , $ key ) ; $ config = $ this -> _arr ; foreach ( $ keys as $ value ) { if ( is_array ( $ config ) ) { if ( array_key_exists ( $ value , $ config ) ) { $ config = $ config [ $ value ] ; } else { return $ defaultValue ; } } else { return $ defaultValue ; } } return $ config ; }
Gets config value based on key.

To access a sub-array you can use a dot separated key.
For example, given this configuration array :

array(
'basePath' => 'somepath',
'params' => array(
'somekey' => 'value of key'
)
);

To access the value of 'somekey', you can call the method like this :

echo $config->get('params.somekey');

The code above will print 'value of key' which is the value of
config 'somekey' in the 'params' array.

@param string $key           Dot-separated string of key
@param mixed $defaultValue   Default value returned when **$key** is not found.

@return mixed Value of config
Gets config value based on key .