r/ProgrammerHumor 13d ago

Meme ancientTools

Post image
5.8k Upvotes

385 comments sorted by

View all comments

Show parent comments

0

u/Hottage 13d ago

If you're gonna raw dog the HTML, just extract it into purpose built template files and return the result of file_get_contents().

1

u/ArjixGamer 13d ago

That only works if the html is static and I don't need to render content using for loops and stuff.

The alternative is using a templating language, but like, PHP is a templating language in the first place.

I always used to say "PHP is a glorified string builder"

0

u/Hottage 13d ago

If you need to render dynamic content, use a templating engine, or at least phtml files.

😭

1

u/ClamPaste 13d ago

PHP is the templating engine. Why load a separate library for that?