title: how to use Chtml::DropDownList()
body: <p>i'm currently a newbie when it comes to the yii framework / php. I would like some assistance creating this Chtml::DropDownList.</p>
  
  <p><a href="http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail" rel="noreferrer">http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail</a></p>
  
  <pre><code>Chtml::dropDownList($name, $select, $data)
  </code></pre>
  
  <p>I understand that $data is the array of data I will be loading in from my Database.</p>
  
  <p>But can someone explain to me how $name, and $select truly works. I have a hard time finding documentation that explains this at a extremely dumbdown level.</p>
  
  <p>I manage to get this piece of code working, but I would prefer using Chtml::dropdownlist.</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;?php
          echo $form-&gt;dropDownList($model, 'id',
          Chtml::listData(UsersTeam::model()-&gt;findAllByAttributes(array('coachId'=&gt;$model-&gt;id)), 'id', 'teamName'),
          array('empty'=&gt;'Select Team'))
      ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to be able to display all teamName for the current user that he is enlisted in.</p>
  
  <p>I'm currently displaying this in the model view of a User, but the information I need is from UserTeam which holds the teams for the users.</p>
  
  <pre><code>        'memberOfTeams' =&gt; array(self::MANY_MANY, 'UsersTeam', '{{teamMembers}}(userId, teamId)'),     
          'coachOfTeams' =&gt; array(self::HAS_MANY, 'UsersTeam', 'coachId'),
  </code></pre>