Return Data not HTML

Functions and methods should return data structures, not rendered HTML. Returning HTML encourages early escaping, HTML parsing, and mixed data processing and output. These are all security and performance issues. What Could Go Wrong? Assembling and handling strings of HTML complicates things as you’re no longer dealing directly with the data, but a particular form […]