title: Retrieve data from controllers and show in views - Yii2-Basic-App
body: <p>In my form, I'm having 8-9 fileds. In which all are hard-coded, Except one, which should come from database.</p>
  
  <p><strong>UsersControllers.php</strong> (controller)</p>
  
  <pre><code>public function actionRegister() 
  {
      .
      .
      model = new Users();
      $modelUserType=UserType::find()-&gt;select(['id', 'type'])-&gt;where(['status' =&gt; 1])-&gt;all();
          return $this-&gt;render('register', [
              'model' =&gt; $model,
              'modelUserType'=&gt;$modelUserType,
              'module' =&gt; $this-&gt;module,
        ]);
  }
  </code></pre>
  
  <p>Values are coming if i do <code>print_r($modelUserType);</code></p>
  
  <p>But, i don't know to show all those "UserType" table values in views for radio button.</p>
  
  <pre><code>&lt;?=
      $form-&gt;field($modelUserType, 'user_type')
      -&gt;radioList(array('1' =&gt; 'An Individual', '2' =&gt; 'Firm')) // Here.
      -&gt;label('Are You')
  ?&gt;
  </code></pre>
  
  <p><strong>register.php</strong> (view)</p>
  
  <pre><code>.
  .
  
  &lt;?= $form-&gt;field($model, 'password')-&gt;passwordInput()-&gt;label('Password') ?&gt; 
  &lt;?= $form-&gt;field($model, 'confirm_password')-&gt;passwordInput()-&gt;label('Confirm Password') ?&gt;
  
  &lt;?=
      $form-&gt;field($model, 'user_type')
      -&gt;radioList(array('1' =&gt; 'An Individual', '2' =&gt; 'Firm'))
      -&gt;label('Are You')
  ?&gt;
  &lt;?= $form-&gt;field($model, 'company_name')-&gt;textInput() ?&gt;
  .
  .
  </code></pre>
  
  <p>I'm not getting any tutorials or I am not able to find the correct tutorials for it. 
  Little help needed. Please help me. Thanks.</p>