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
Post a Comment