title: how to display time from db table into drop downlist yii2?
body: <p>this is my form field for dropdown list <code>Time</code></p>
  
  <pre><code>&lt;?= $form-&gt;field($model, 'Time')-&gt;widget(Select2::classname(), [
              'data' =&gt; ArrayHelper::map(Schedule::find()-&gt;where(['username' =&gt; 'cust_id', 'day'=&gt;'Day_cust','availability'=&gt;'available'])-&gt;all(),'time','time'),
              'language' =&gt; 'en',
              'options' =&gt; ['placeholder' =&gt; 'Select available time ...'],
              'pluginOptions' =&gt; [
              'allowClear' =&gt; true
              ],
          ]);
          ?&gt; 
  </code></pre>
  
  <p><code>Day_cust</code> and <code>cust_id</code> is taken from the previous text input in the same form which is field by the user.</p>
  
  <p>I have tried the above code but it failed to display the time available.</p>
  
  <p>this is my model for schedule</p>
  
  <pre><code>public function attributeLabels()
  {
      return [
          'schedule_id' =&gt; 'Schedule ID',
          'username' =&gt; 'Username',
          'day' =&gt; 'Day',
          'time' =&gt; 'Time',
          'availability' =&gt; 'Availability',
      ];
  }
  </code></pre>
  
  <p>what I want is I want to display on the drop-down list for <code>time</code> the time input in the database with the availability <code>available</code> based on <code>cust_id</code> and <code>day</code> insert by the user in the field.</p>
  
  <p>how should I do it?</p>
  
  <p>if anyone wonder why i dont use dependent dropdownlist is because the cust_id is using text input same goes with the day. i didnt use the ddl for both of them.</p>