title: Twig Setting Select Option on a dropdown
body: <p>I am currently writing a php mvc  from scratch and using twig as my template engine and need some assistance setting the selected option on a drop down list. Currently in my model I have an sql query that pull all list of supervisors and drops them in my drop down list using the twig for loop but I need to some how select a user’s supervisor if it matches up.</p>
  
  <p>I apologize now as I am new to twig</p>
  
  <p>View: 
  </p>
  
  <pre><code>&lt;select class="form-control" id="supervisor"&gt;
        {% for supervisor in supervisor %}
        &lt;option value="{{supervisor.fname}} {{supervisor.lname}}" &gt;{{supervisor.fname}} {{supervisor.lname}}&lt;/option&gt;
        {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
  
  
  <p>Tried: 
  </p>
  
  <pre><code>&lt;select class="form-control" id="supervisor"&gt;
        {% for supervisor in supervisor %}
  {% if {{supervisor.fname}} {{supervisor.lname}} == {{ user.supervisor }} %}
              &lt;option value=”{{supervisor.fname}} {{supervisor.lname}}” selected&gt;{{supervisor.fname}} {{supervisor.lname}}&lt;/option&gt;
  {% else %}
      &lt;option value=”{{supervisor.fname}} {{supervisor.lname}}”&gt;{{supervisor.fname}} {{supervisor.lname}}&lt;/option&gt;
  {% endif %}
        {% endfor %}
  &lt;/select&gt;
  </code></pre>