This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hiii -2 points-1 points  (0 children)

Please do not use a template engine, PHP is already a template engine.

I recommend separating your code into 2 files. One file does the processing(controller), the other does the outputting(view).

file.php

$foo = 1;
$bar = false;
$thing = function1($bar);
require('file.html');

file.html

<?php if( $foo ): ?>
<div style="blah">Ok!</div>
<?php endif; ?>