php - access session or Yii in config file -


i want access session or yii::$app in config file ( config/main.php or config/main-local.php) !
possible or not?
want check session , make style available!

'components' => [     'assetmanager' => [         'assetmap' => [             'r.css' => yii::$app->session['lang'] ? 'css/styleltr.css' : 'css/stylertl.css' ,         ],     ], 

or how in assetmanager????

you can't access user session in config file. but, use conditional in layout , register different assets based on session values.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -