You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reasoning: HTML should not be trapped inside echo statements. It prevents modern editors from syntax-checking the HTML or colourising it. Also, there's less need for concatenation, so it looks nicer.
Incidentally, I've swapped the brace-style foreach for a colon-style. There's a rule of thumb that the former belongs in code files and the colon-style is preferred in template files, because the ending is much more explicit. Not essential for this ticket but nice to add, IMO.
I expect there are others too, but it's worth raising a ticket to see if this is in keeping with house style first. Of course, htmlspecialchars() is required too, but that's another ticket.
The text was updated successfully, but these errors were encountered:
I suggest the following code (taken from here):
becomes like so:
Reasoning: HTML should not be trapped inside echo statements. It prevents modern editors from syntax-checking the HTML or colourising it. Also, there's less need for concatenation, so it looks nicer.
Incidentally, I've swapped the brace-style
foreach
for a colon-style. There's a rule of thumb that the former belongs in code files and the colon-style is preferred in template files, because the ending is much more explicit. Not essential for this ticket but nice to add, IMO.I expect there are others too, but it's worth raising a ticket to see if this is in keeping with house style first. Of course,
htmlspecialchars()
is required too, but that's another ticket.The text was updated successfully, but these errors were encountered: