3 ms·
"PHP encourages you NOT to separate presentation and logic." Is this a stated policy, or are you inferring it based on the structure of PHP being embedded in H
by mikepurvis 17y ago
"PHP encourages you NOT to separate presentation and logic."
Is this a stated policy, or are you inferring it based on the structure of PHP being embedded in HTML?
There's nothing about PHP which prevents separating the two. There are even the shorter tags and braceless syntax, which are especially friendly to templating. Eg,
<? foreach($pages as $page): ?>
<h2><?= $page->title ?>
<div class="content">
<?= paragraphs($page->content) ?>
</div>
<? endforeach; ?>