无法访问 laravel 5.2 中的常量变量
cannot access to constant variable in laravel 5.2
我想在常量文件夹中分隔我的字符串,我创建了一些文件来定义我的常量,但是当我想访问它们时,blade、控制器等没有任何显示,我尝试访问在 blade
中使用此语法
{{config('constants.welcomeConstants.title')}}
但 blade 中没有任何显示,请帮助我,我将所有字符串分开,现在我的 Web 应用程序中没有文本
我的常量文件是:
<?php
return [
'title' => 'test'
];
// /config/constants.php
return [
'welcome' => [
'hello' => 'Hello',
],
];
// Access config value
config('constants.welcome.hello');
只需使用
php artisan config:clear or php artisan config:cache
我想在常量文件夹中分隔我的字符串,我创建了一些文件来定义我的常量,但是当我想访问它们时,blade、控制器等没有任何显示,我尝试访问在 blade
中使用此语法 {{config('constants.welcomeConstants.title')}}
但 blade 中没有任何显示,请帮助我,我将所有字符串分开,现在我的 Web 应用程序中没有文本
我的常量文件是:
<?php
return [
'title' => 'test'
];
// /config/constants.php
return [
'welcome' => [
'hello' => 'Hello',
],
];
// Access config value
config('constants.welcome.hello');
只需使用
php artisan config:clear or php artisan config:cache