使用最新版本的cakephp3。我有一个我正在尝试安装的插件。在插件文件夹中,我看到它正在使用自己的bootstrap.php执行以下代码。
Configure::config('default', new PhpConfig(dirname(APP) . DS . 'config' . DS));
Configure::load('recaptcha', 'default', false);我正确地创建了文件- app/config/recaptcha.php
return [
'Recaptcha' => [
// Register API keys at https://www.google.com/recaptcha/admin
'sitekey' => 'your-sitekey',
'secret' => 'your-secret',
// reCAPTCHA supported 40+ languages listed
// here: https://developers.google.com/recaptcha/docs/language
'lang' => 'en',
// either light or dark
'theme' => 'light',
// either image or audio
'type' => 'image',
]
];当我尝试使用
Configure::read('Recaptcha'));我得到一个空的结果。我的假设是他们加载配置文件的方式是错误的,有人能建议一下吗?
发布于 2015-08-21 11:12:36
Configure::config('default',新的PhpConfig(目录名称(应用程序)。DS .“‘config”。DS));
插件不应设置default配置读取器。它应该在app的bootstrap中完成。我建议插件作者删除这行代码。
我正确地创建了文件- app/config/recaptcha.php
在标准的Cake 3文件夹结构中没有"app“文件夹。
https://stackoverflow.com/questions/32127677
复制相似问题