The foreach creates a quite a complex navigation system, including a header bar with 6 links, each of which, when clicked, shows a “mega menu” (in CSS speak). The image I am having issues with is displayed on the left of this mega menu.
That aside, the problem is nothing to do with the other code as:
I know I have $course_groups as an array of objects (I have successfully used the $title property of the first object just above this code and I know I do have an $id property available. This from debugging.
If I just use your code but replace this (<?=$vertical_group->id ?>) with this (1), it works perfectly.
p.s. You can see from my code in my later post that the values are actually different in reality. I did simplify for the post but have expanded the reply to the true values before testing. Use the later ones if you want.
So this doesn’t work:
<img src="/img/raster/vertical_groups<?=$vertical_group->vertical_group_id ?>.jpg">
But this does:
And the “error” I’m getting is that, when I view the page, I get only the first navigation link (so the foreach has only looped once) and I also don’t get the mega menu at all (so the loop is incomplete - debugging just breaks out when it gets to this line… rather unhelpfully… doesn’t say why just jumps out of the debug process… I’m using xdebug and vim)
So the code is “stopping” at this line but I have no idea why?
I can post the code for the whole template and the controller that feeds it the $course_groups array if you’d like (fair bit of it).