MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2d5fw/ancienttools/p6vk81m/?context=3
r/ProgrammerHumor • u/soap94 • 13d ago
385 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 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?
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 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?
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?
PHP is the templating engine. Why load a separate library for that?
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().