首页 > 代码库 > yii2:如果获取config/web.php配置的值?

yii2:如果获取config/web.php配置的值?

return [
    ‘version‘ => ‘1.0.1‘,
    ‘category-map‘ => [
        1 => ‘样式1‘,
        2 => ‘样式2‘,
        3 => ‘样式3‘,
        4 => ‘样式4‘,
        5 => ‘样式5‘,
        6 => ‘样式6‘
    ]
];

  配置在@app/config/params.php里,

读取方式为Yii::$app->params[‘paramsName‘]
比如Yii::$app->params[‘sitename‘]

yii2:如果获取config/web.php配置的值?