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

        // extract TypoScript-path information
        $nodeSections  = explode('.', $tsNodePath);
        $nodeValueType = end($nodeSections);
        $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 {
                    break;
                }
            }
        }

        // Fetch TypoScript configuration data
        $tsData = array();
        if (is_array($nodeData) && array_key_exists($nodeValueName, $nodeData)) {
            $tsData = $nodeData[$nodeValueName];
        }

        // Fetch TypoScript configuration type
        $tsType = null;
        if (is_array($nodeData) && array_key_exists($nodeValueType, $nodeData)) {
            $tsType = $nodeData[$nodeValueType];
        }

        // Clone object and set values
        $ret                   = clone $this;
        $ret->tsData           = $tsData;
        $ret->tsType           = $tsType;
        $ret->iteratorPosition = false;

        return $ret;
    }
public function getNode($tsNodePath)
    {
        $ret = null;

        // extract TypoScript-path information
        $nodeSections  = explode('.', $tsNodePath);
        $nodeValueType = end($nodeSections);
        $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 {
                    break;
                }
            }
        }

        // Fetch TypoScript configuration data
        $tsData = array();
        if (is_array($nodeData) && array_key_exists($nodeValueName, $nodeData)) {
            $tsData = $nodeData[$nodeValueName];
        }

        // Fetch TypoScript configuration type
        $tsType = null;
        if (is_array($nodeData) && array_key_exists($nodeValueType, $nodeData)) {
            $tsType = $nodeData[$nodeValueType];
        }

        // Clone object and set values
        $ret                   = clone $this;
        $ret->tsData           = $tsData;
        $ret->tsType           = $tsType;
        $ret->iteratorPosition = false;

        return $ret;
    }
public function getNode ( $ tsNodePath ) { $ ret = null ; // extract TypoScript-path information $ nodeSections = explode ( '.' , $ tsNodePath ) ; $ nodeValueType = end ( $ nodeSections ) ; $ 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 { break ; } } } // Fetch TypoScript configuration data $ tsData = array ( ) ; if ( is_array ( $ nodeData ) && array_key_exists ( $ nodeValueName , $ nodeData ) ) { $ tsData = $ nodeData [ $ nodeValueName ] ; } // Fetch TypoScript configuration type $ tsType = null ; if ( is_array ( $ nodeData ) && array_key_exists ( $ nodeValueType , $ nodeData ) ) { $ tsType = $ nodeData [ $ nodeValueType ] ; } // Clone object and set values $ ret = clone $ this ; $ ret -> tsData = $ tsData ; $ ret -> tsType = $ tsType ; $ ret -> iteratorPosition = false ; return $ ret ; }
Get TypoScript subnode

@param       string $tsNodePath TypoScript node-path

@return      TypoScript       TypoScript subnode-object
Get TypoScript subnode