5 ms·
Why not just leave the "{{ }}" out and assume the mammouth file is 100% PHP?
by scragg 13y ago
Why not just leave the "{{ }}" out and assume the mammouth file is 100% PHP?
- cheald 13y agoProbably because then you'd have to have a templating language implemented in a templating language in order to render templates.
- jacques_chester 13y agoWelcome to the PHP ecosystem.
- stormbrew 13y agoAt the very least it'd make more sense to invert the expectation. {{<html>}} instead of {{php}}html{{php}}. The way around php has it is both annoying, since most php is not mere template anymore, and error-prone, thanks to the potential problems from trailing whitespace.
- ars 13y ago> thanks to the potential problems from trailing whitespace. You are supposed to leave out the closing ?> in the PHP file - then you don't have that problem. Inverting doesn't really make any sense: <P><?=$message?></P> The HTML is primary, the PHP is used to output whatever is needed.
- stormbrew 13y agoI'm aware you're supposed to leave out the closing ?>, but a lot of people don't. In fact, the example on the front page of this project doesn't leave out the trailing }}, either, incidentally. As for your little snippet, inverting does make sense: <?php // ... 1000 lines of php ...?><p><?=$message?></p><?... // ... 1000 lines of php ?> But tacky little examples aside, there's nothing stopping <?= tags from working just as they always have once you've escaped into html.