Classes/Utility/TypoScript.php
public function getValue($tsNodePath, $defaultValue = null)
    {
        $ret = $defaultValue;

        // extract TypoScript-path information
        $nodeFound     = true;
        $nodeSections  = explode('.', $tsNodePath);
        $nodeValueName = end($nodeSections);

        // remove last node from sections because we already got the node name
        unset($nodeSections[key($nodeSections)]);

        // walk though array to find node
        $nodeData = $this->tsData;
        if (!empty($nodeSections) && is_array($nodeSections)) {
            foreach ($nodeSections as $sectionName) {
                $sectionName .= '.';

                if (is_array($nodeData) && array_key_exists($sectionName, $nodeData)) {
                    $nodeData = $nodeData[$sectionName];
                } else {
                    $nodeFound = false;
                    break;
                }
            }
        }

        // check if we got the value of the node
        if ($nodeFound && is_array($nodeData) && array_key_exists($nodeValueName, $nodeData)) {
            $ret = $nodeData[$nodeValueName];
        }


        return $ret;
    }
public function getValue($tsNodePath, $defaultValue = null)
    {
        $ret = $defaultValue;

        // extract TypoScript-path information
        $nodeFound     = true;
        $nodeSections  = explode('.', $tsNodePath);
        $nodeValueName = end($nodeSections);

        // remove last node from sections because we already got the node name
        unset($nodeSections[key($nodeSections)]);

        // walk though array to find node
        $nodeData = $this->tsData;
        if (!empty($nodeSections) && is_array($nodeSections)) {
            foreach ($nodeSections as $sectionName) {
                $sectionName .= '.';

                if (is_array($nodeData) && array_key_exists($sectionName, $nodeData)) {
                    $nodeData = $nodeData[$sectionName];
                } else {
                    $nodeFound = false;
                    break;
                }
            }
        }

        // check if we got the value of the node
        if ($nodeFound && is_array($nodeData) && array_key_exists($nodeValueName, $nodeData)) {
            $ret = $nodeData[$nodeValueName];
        }


        return $ret;
    }
public function getValue ( $ tsNodePath , $ defaultValue = null ) { $ ret = $ defaultValue ; // extract TypoScript-path information $ nodeFound = true ; $ nodeSections = explode ( '.' , $ tsNodePath ) ; $ nodeValueName = end ( $ nodeSections ) ; // remove last node from sections because we already got the node name unset ( $ nodeSections [ key ( $ nodeSections ) ] ) ; // walk though array to find node $ nodeData = $ this -> tsData ; if ( ! empty ( $ nodeSections ) && is_array ( $ nodeSections ) ) { foreach ( $ nodeSections as $ sectionName ) { $ sectionName .= '.' ; if ( is_array ( $ nodeData ) && array_key_exists ( $ sectionName , $ nodeData ) ) { $ nodeData = $ nodeData [ $ sectionName ] ; } else { $ nodeFound = false ; break ; } } } // check if we got the value of the node if ( $ nodeFound && is_array ( $ nodeData ) && array_key_exists ( $ nodeValueName , $ nodeData ) ) { $ ret = $ nodeData [ $ nodeValueName ] ; } return $ ret ; }
Get value from node

@param       string $tsNodePath   TypoScript node-path
@param       mixed  $defaultValue Default value

@return      mixed                                   Node value (or default value)
Get value from node