From 087af701793e6fb9853045cd44e0cc7fc47e1bfb Mon Sep 17 00:00:00 2001 From: Rafal Marguzewicz Date: Sun, 8 Dec 2019 21:29:49 +0100 Subject: [PATCH] Fix bad link in modules --- LanguageSelection.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/LanguageSelection.php b/LanguageSelection.php index 1eda9cc..d646d16 100644 --- a/LanguageSelection.php +++ b/LanguageSelection.php @@ -2,7 +2,7 @@ namespace pceuropa\languageSelection; use Yii; -use yii\helpers\Html; +use yii\helpers\{Html, Url}; use pceuropa\languageSelection\LanguageAsset; class LanguageSelection extends \yii\base\Widget { @@ -39,15 +39,14 @@ public function patchFlag($lang){ public function allFlag(){ $items = ''; - foreach ($this->language as $key => $value) { if (Yii::$app->language != $value){ $img = Html::img( $this->patchFlag($value)); - $a = Html::a ($img , ['', $this->languageParam => $key] ); + $a = Html::a($img, Url::current([$this->languageParam => $key])); $items .= Html::tag('li',$a ); } } - + return $items; }