This is my yii2 url
/stock-count/area-chart/stock-area-chart?AreaChart%5Bcompany_code%5D=001&AreaChart%5Bdivision_code%5D=03&AreaChart%5Blocation%5D=0201
I want to access 'company_code' from url in view page
This is my yii2 url
/stock-count/area-chart/stock-area-chart?AreaChart%5Bcompany_code%5D=001&AreaChart%5Bdivision_code%5D=03&AreaChart%5Blocation%5D=0201
I want to access 'company_code' from url in view page
You are looking for parsing and getting data from URL Query string. Refer this Stackoverflow answer
AreaChartController.php
$company_code = Yii::$app->request->get('AreaChart[company_code]', 'DEFAULT_VALUE');
return $this->render('view_file', ['company_code' => $company_code]);
view_file.php
<div class="company-code"><?= $company_code ?></div>