title: yii2 Undefined variable in form
body: <p>When running the code:</p>
  
  <pre><code>return $this-&gt;render('update', [
     'model' =&gt; $model,
     'stok' =&gt; $stok
     ]);
  </code></pre>
  
  <p>I get an error related to undefined variable:</p>
  
  <blockquote>
    <p>PHP Notice 'yii\base\ErrorException' with message 'Undefined variable:
    stok'</p>
  </blockquote>
  
  <p>My form is as follows:</p>
  
  <pre><code>&lt;div class="col-sm-2"&gt;
     &lt;?= $form-&gt;field($stok, 'harga_jual1')-&gt;textInput(['id' =&gt; 'hargaRetail'])-&gt;label('Harga Retail') ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I resolve this error?</p>