草庐IT

SiteConfig

全部标签

php - 在 _config.php 中获取 SiteConfig 变量

在SilverStripe3.4.1中,我想通过管理设置控制_config.php文件值。我想在Admin>Settings>MyTab中设置一些变量,然后在_config.php中访问这些变量。有没有办法访问_config.php文件中的SiteConfig变量?我尝试使用几种不同的方式来获取配置数据:Config::inst()print_r/var_dump将所有值作为数组给出Config::inst()->get($this->class,'PropertyName')或$this->config()->get('PropertyName')返回空SiteConfig::cur