title: How to get value dropdowns in yii2
body: <p>I am trying to do a Yii2 application.
  I want to make highcharts in yii 2. these highcharts will change depending on the input that comes from the dropdown. 
  I can not retrieve the value from the dropdown for use in the showby function.
  how can i retrieve value from dropdown?</p>
  
  <p>This is my code Controller below.</p>
  
  <pre><code>public function actionIndex()
  {
      $searchModel = new kntnRPemesananSearch();
      $options =  new RBarangSearch();
  
  $data = Yii::$app-&gt;db-&gt;createCommand('select week(tanggal)+1 as tanggal,harga,nama from kntn_r_barang_masuk where nama = "beras" group by tanggal')-&gt;queryAll();
  //print_r($data);
  return $this-&gt;render('index', ['ddiagram' =&gt; $data,'model'=&gt; $searchModel,'opt'=&gt;$options]);
  
  }
  
  public function actionShowBy($nama_barang){
      $searchModel = new kntnRPemesananSearch();
      $options =  new RBarangSearch();
  
  $data = Yii::$app-&gt;db-&gt;createCommand('select week(tanggal)+1 as tanggal,harga,nama from kntn_r_barang_masuk where nama ="'.$nama_barang.'" group by tanggal')-&gt;queryAll();
  //print_r($data);
  return $this-&gt;render('index', ['ddiagram' =&gt; $data,'model'=&gt; $searchModel,'opt'=&gt;$options]);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and this my code view</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="form_pemesanan"&gt;
  &lt;?php $form = ActiveForm::begin(); ?&gt;
     &lt;div class="field_input"&gt;
         &lt;?= $form-&gt;field($opt, 'nama_barang')-&gt;dropDownList(ArrayHelper::map(RBarang::find()-&gt;all(),'nama_barang','nama_barang'),['prompt'=&gt;'Barang']); 
         ?&gt;
         
         &lt;?= Html::a('Pilih', ['grafik/show-by','nama_barang'=&gt;$opt-&gt;nama_barang], ['class'=&gt;'btn btn-primary']) ?&gt;
      &lt;/div&gt;
  
      &lt;div class="field_input col-sm-offset-11"&gt;
      &lt;?
      
      ?&gt;
         
      &lt;/div&gt;
  &lt;?php ActiveForm::end(); ?&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>how can i retrieve value from dropdowns and send value from dropdown to function showby?
  thanks before.</p>