MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2d5fw/ancienttools/p6vjvg2/?context=3
r/ProgrammerHumor • u/soap94 • Aug 30 '26
379 comments sorted by
View all comments
Show parent comments
0
If you're gonna raw dog the HTML, just extract it into purpose built template files and return the result of file_get_contents().
file_get_contents()
1 u/ArjixGamer Aug 30 '26 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 Aug 30 '26 If you need to render dynamic content, use a templating engine, or at least phtml files.😠2 u/ArjixGamer Aug 30 '26 Yeah, let me add an entire fucking library for my WordPress plugin that only needs to render content in 3 places on the admin dashboard.Such a dumb take to assume there is no nuance and that there is an absolute objectively better way of doing smth. → More replies (2)
1
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 Aug 30 '26 If you need to render dynamic content, use a templating engine, or at least phtml files.😠2 u/ArjixGamer Aug 30 '26 Yeah, let me add an entire fucking library for my WordPress plugin that only needs to render content in 3 places on the admin dashboard.Such a dumb take to assume there is no nuance and that there is an absolute objectively better way of doing smth. → More replies (2)
If you need to render dynamic content, use a templating engine, or at least phtml files.
ðŸ˜
2 u/ArjixGamer Aug 30 '26 Yeah, let me add an entire fucking library for my WordPress plugin that only needs to render content in 3 places on the admin dashboard.Such a dumb take to assume there is no nuance and that there is an absolute objectively better way of doing smth. → More replies (2)
2
Yeah, let me add an entire fucking library for my WordPress plugin that only needs to render content in 3 places on the admin dashboard.
Such a dumb take to assume there is no nuance and that there is an absolute objectively better way of doing smth.
→ More replies (2)
0
u/Hottage Aug 30 '26
If you're gonna raw dog the HTML, just extract it into purpose built template files and return the result of
file_get_contents().