elementFinder() public static method

Find an element in a nested hasharray $haystack with a string $needle separated by $delimiter
public static elementFinder ( $needle, array $haystack, string $delimiter = '.' ) : null
$needle
$haystack array
$delimiter string
return null
 /**
  * Set portal config.
  *
  * @throws InvalidArgumentException
  */
 protected function setConfig()
 {
     $config = $this->yii->params['portal'];
     if (!$config) {
         throw new InvalidArgumentException('Missing portal configuration for ' . __CLASS__);
     }
     foreach (static::$required_config_keys as $k) {
         if (Helper::elementFinder($k, $config) === null) {
             throw new InvalidArgumentException('Missing required config parameter for ' . __CLASS__);
         }
     }
     $this->config = $config;
 }
示例#2
0
 /**
  * Simple abstraction to pull a param from yii config separated by dots.
  * @param $config
  * @param $key
  * @return null
  */
 private function getParamAttribute($config, $key)
 {
     return Helper::elementFinder($key, $config);
 }