如何将TYPO3 Typoscript常量文件转换为数组或JSON格式?

问题描述 投票:0回答:1

以下是我的TYPO3 Typoscript常量文件,我想使用php将此文件转换为数组格式。 (我使用Laravel 5.5框架)。

这是我的constant.ts文件:

settings {
  social {
    # cat=jay: advanced/120/100; type=integer; label=Facebook page
    facebook = http://www.facebook.com
    # cat=jay: advanced/120/110; type=integer; label=Twitter account
    twitter = https://twitter.com
    # cat=jay: advanced/120/120; type=integer; label=Google Plus Account
    google = https://plus.google.com
    # cat=jay: advanced/120/130; type=integer; label=Direct Mail
    mail = [email protected]
  }

  # cat=jay: advanced/120/140; type=string; label=Path to logo file
  logo = 
}

我在做什么: 我用这个文件读了

$jsonString = file_get_contents(storage_path() . "/jay/Configuration/TypoScript/Constants/Settings.ts");

那么如何将此文件转换为正确的数组或JSON格式?

php arrays json typo3 typoscript
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.