消息:
找不到类"帮助程序\配置"
文件:应用程序/类/助手/助手.php
public static function getDictionary(){
$timezone = Config::get('app.dictionary');
文件:配置/应用程序.php。
'aliasis => array(
'Helper' => 'HelpersHelper'
文件:应用程序/配置/应用程序.php
'dictionary' => array(
'EMAIL' => 'crm@xxxx.com',
'VERSION' => "1.0.0"
)
我错过了任何命名空间或使用行吗?
因为您位于HelpersHelper
文件中的命名空间中,所以当您引用该文件中的Config
时,PHP 假定您指的是 Helpers
命名空间中的一个类。你需要在它前面加上一个,说你的意思是类
Config
"根",或者使用use
语句:
-
直接参考:
$timezone = Config::get('app.dictionary');
-
use
它:use Config; class Helper { public static function getDictionary() { $timezone = Config::get('app.dictionary'); // ... } }