public static function extractTypoScriptKeyForPidAndType($id, $typeNum, $key)
    {
        $key = trim($key);
        if (!strlen($key)) {
            throw new \RuntimeException(sprintf('Invalid TypoScript key "%s"', $key), 1481365294);
        }

        // Get a frontend controller for the page id and type
        $TSFE = self::getTSFE($id, $typeNum);
        list($name, $conf) = GeneralUtility::makeInstance(TypoScriptParser::class)->getVal($key, $TSFE->tmpl->setup);
        $lastKey = explode('.', $key);
        $lastKey = array_pop($lastKey);

        return [$lastKey => $name, $lastKey.'.' => $conf];
    }
public static function extractTypoScriptKeyForPidAndType($id, $typeNum, $key)
    {
        $key = trim($key);
        if (!strlen($key)) {
            throw new \RuntimeException(sprintf('Invalid TypoScript key "%s"', $key), 1481365294);
        }

        // Get a frontend controller for the page id and type
        $TSFE = self::getTSFE($id, $typeNum);
        list($name, $conf) = GeneralUtility::makeInstance(TypoScriptParser::class)->getVal($key, $TSFE->tmpl->setup);
        $lastKey = explode('.', $key);
        $lastKey = array_pop($lastKey);

        return [$lastKey => $name, $lastKey.'.' => $conf];
    }
public static function extractTypoScriptKeyForPidAndType ( $ id , $ typeNum , $ key ) { $ key = trim ( $ key ) ; if ( ! strlen ( $ key ) ) { throw new \ RuntimeException ( sprintf ( 'Invalid TypoScript key "%s"' , $ key ) , 1481365294 ) ; } // Get a frontend controller for the page id and type $ TSFE = self :: getTSFE ( $ id , $ typeNum ) ; list ( $ name , $ conf ) = GeneralUtility :: makeInstance ( TypoScriptParser :: class ) -> getVal ( $ key , $ TSFE -> tmpl -> setup ) ; $ lastKey = explode ( '.' , $ key ) ; $ lastKey = array_pop ( $ lastKey ) ; return [ $ lastKey => $ name , $ lastKey . '.' => $ conf ] ; }
Extract and return a TypoScript key for a particular page and type

@param int $id      Page ID
@param int $typeNum Page type
@param string $key  TypoScript key

@return array TypoScript values
@throws \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException
@throws \Exception If the TypoScript key is invalid
Extract and return a TypoScript key for a particular page and type