Dawaine Leslie
Dawaine Leslie

Reputation: 7

How to pull data from Database in Symfony

I would like to display the start and end date from the database in a label but for now, I'm able to pull the record id, I'm not how I would pull the start and end date instead of the record id. What I have so far.

<label for="Record">Record</label>
                        <select name="record">
                            {%for record in records %}
                                <option value="{{record.recordid}}">{{ record }}</option>
                            {%endfor %}
                        </select>

Upvotes: 0

Views: 106

Answers (1)

abderrahime sanadi
abderrahime sanadi

Reputation: 482

 <label for="Record">Record</label>
                    <select name="record">
                        {%for record in records %}
                            <option value="{{record.recordid}}">{{ 
  record.startDate }} -- {{ record.endDate }}
  </option>
                        {%endfor %}
                    </select>

Upvotes: 1

Related Questions