Composing table rows to match the info
Hello.
I'll try to explain my problem as best I can. (Also posted on SO
So link )
Basically I have this entity
array:11 [▼
"id" => "90ac3458-5fb2-11e6-a926-0a0027000004"
"startat" => DateTime {#505 ▶}
"comment" => "The former represent only themselves and the latter represent those who share their corporate identity\n"
"place_id" => "cd673b65-5d6e-11e6-b1ff-000d3ab2c2b6"
"sponsor_id" => "e12165d6-7c5c-2e23-eb3b-8828e39a0ede"
"tour_id" => "170e9b35-abb3-6337-96f6-342a6778d3c8"
"speaker" => array:2 [▼ 0 => array:3 [▼ "id" => "2d2d2d4a-5e16-11e6-a6b0-0a0027000003" "contact_id" => "d5472568-7db7-350d-d3b8-38e13c2fce67" "contact" => array:6 [▼ "id" => "d5472568-7db7-350d-d3b8-38e13c2fce67" "firstname" => "Caim" "lastname" => "Astraea" "phone" => "" "mobile" => "" "email" => "email@email.com" ] ] 1 => array:3 [▼ "id" => "ce24d7e8-638c-11e6-99ed-0a0027000004" "contact_id" => "666a58f8-9d15-166c-5686-62d94e18d1cf" "contact" => array:6 [▼ "id" => "666a58f8-9d15-166c-5686-62d94e18d1cf" "firstname" => "test3" "lastname" => "test4" "phone" => "123" "mobile" => "123" "email" => "test@test.com" ] ] ]
"place" => array:11 [▼ "id" => "cd673b65-5d6e-11e6-b1ff-000d3ab2c2b6" "name" => "CINE BREIZ " "address" => "1 RUE HENRI DUNANT " "website" => null "map" => null "salles" => "main" "codpostal" => "22500" "contact_id" => "d5472568-7db7-350d-d3b8-38e13c2fce67" "city_id" => "466C3908-0064-42FC-872A-61704C93BC1B" "contact" => array:6 [▶] "city" => array:4 [▶] ]
"sponsor" => array:10 [▶]
"tour" => array:2 [▶]
"diffusion" => array:5 [▼ 0 => array:4 [▼ "id" => "d8646396-6391-11e6-99ed-0a0027000004" "hour" => "12:14" "movie_id" => "6027b5ee-cfea-e31b-59c9-36d343e5562d" "movie" => array:5 [▼ "id" => "6027b5ee-cfea-e31b-59c9-36d343e5562d" "name" => "Madagascar" "description" => "" "duration" => 15 "status" => "enabled" ] ] 1 => array:4 [▶] 2 => array:4 [▶] 3 => array:4 [▶] 4 => array:4 [▶] ]
]
with which I'm trying to fill out the table. The problem I'm having some of these (called them diffusion) have variable number of movies and speakers so would need to format the rows to match by : appending <td></td> to match the maximum number of diffusions / speakers and also by case display the info in the proper cell by prepending a <td></td ?
For example if row 1 has films : Madagascar and Usa
and row 2 for the second entity only has the Usa would need the hour to be on the usa column not the first one.
This screencast shows it in more detail I hope
How should I go about this? Any clues would be greatly appreciated ~