5
Come utilizzare Yii::$app->session['somename']
in yii2 assetmanager?usa la funzione personalizzata in assetmanager
Come accedere ad alcune funzioni in assetmanager?
class AppAsset extends AssetBundle{
public function getLang() {
$currentLang = Yii::$app->session['lang'];
if ($currentLang == 'fa' || $currentLang == 'ar') {
return 'RTL';
} else {
return 'LTR';
}
}
public $lang;
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/iconSprite.min.css',
// how call getLang here
]
Come chiamare getLang
nella parte css?
questo è quello che sto cercando! perfezionare!!! – mohsen