How can we separate Logic from presentation without using any template engine (traditional php-not OOP) Thank in advance
Why not to use PHP itself as a template engine? It being used in the code I posted for your other question. Your program has to be split into 2 main sections: getting data and displaying data.
Each page have to have it's own template. In the code I posted there is 2 very simple templates, form.php
and list.php
just extend it with the whole site template, And you have done!
Here is a little more complex PHP template example:
foreach ($data as $row): ?>
=$row['name']?>
=$row['date'] ?>
=$row['body'] ?>
if ($row['answer']): ?>
Answer:
=$row['answer'] ?>
endif ?>
if($admin): ?>
=$row['id']?> - =$row['ip']?> - =$row['topic']?>
if($row['del']): ?>
show
else: ?>
hide
endif ?>
edit
endif ?>
endforeach ?>
And it is called like this
//some code to get data
include 'tpl_top.php';
include 'tpl_list.php';
include 'tpl_bottom.php';
?>
Looks magnificent to me!
Dunno though, if it's what you're asking for :)