public function getConfig($name, $default = null)
    {
        /*
         * Array field name, eg: field[key][key2][key3]
         */
        $keyParts = HtmlHelper::nameToArray($name);

        /*
         * First part will be the field name, pop it off
         */
        $fieldName = array_shift($keyParts);
        if (!isset($this->config->{$fieldName})) {
            return $default;
        }

        $result = $this->config->{$fieldName};

        /*
         * Loop the remaining key parts and build a result
         */
        foreach ($keyParts as $key) {
            if (!array_key_exists($key, $result)) {
                return $default;
            }

            $result = $result[$key];
        }

        return $result;
    }
public function getConfig($name, $default = null)
    {
        /*
         * Array field name, eg: field[key][key2][key3]
         */
        $keyParts = HtmlHelper::nameToArray($name);

        /*
         * First part will be the field name, pop it off
         */
        $fieldName = array_shift($keyParts);
        if (!isset($this->config->{$fieldName})) {
            return $default;
        }

        $result = $this->config->{$fieldName};

        /*
         * Loop the remaining key parts and build a result
         */
        foreach ($keyParts as $key) {
            if (!array_key_exists($key, $result)) {
                return $default;
            }

            $result = $result[$key];
        }

        return $result;
    }
public function getConfig ( $ name , $ default = null ) { /*
         * Array field name, eg: field[key][key2][key3]
         */ $ keyParts = HtmlHelper :: nameToArray ( $ name ) ; /*
         * First part will be the field name, pop it off
         */ $ fieldName = array_shift ( $ keyParts ) ; if ( ! isset ( $ this -> config -> { $ fieldName } ) ) { return $ default ; } $ result = $ this -> config -> { $ fieldName } ; /*
         * Loop the remaining key parts and build a result
         */ foreach ( $ keyParts as $ key ) { if ( ! array_key_exists ( $ key , $ result ) ) { return $ default ; } $ result = $ result [ $ key ] ; } return $ result ; }
Safe accessor for configuration values.
@param string $name Config name, supports array names like "field[key]"
@param string $default Default value if nothing is found
@return string
Safe accessor for configuration values .