Hoe To Pass Value In Url

I want to username pass in url =>[‘site/updateuser’].

and m using below code…




$menuItems[] = [

                  'label' => Yii::$app->user->identity->username,

                  'items' => [

                  ['label' => 'View profile', 'url' => ['site/updateuser']],

                  '<li class="divider"></li>',

                  ['label' => 'Edit profile', 'url' => ['#']],

                  '<li class="divider"></li>',

                  ['label' => 'Logout', 'url' => ['site/logout'],'linkOptions' => ['data-method' => 'post']],

                      

                  ],

                ];




and how to fetch username in this function


public function actionUpdateuser()

    {

    }



so what can i changes in this code ?

you can add the username as key value pair in url array like so


['label' => 'View profile', 'url' => ['site/updateuser', 'username' => Yii::$app->user->identity->username]],





public function actionUpdateuser()

{

	$username = $_GET['username'];

}

thank u…