welcome to ...

pure-PHP templating

Hi. Here is a set of simple php scripts introdusing the idea -

" php - is a great template engine itself "

Better start looking into their source and try to guess what you'll see visiting them in your browser.

home master.php control.php top.php foot.php derived.php block.php helper.php templatelib.php multipass.php
<?include('templatelib.php'); /*for multipass functions*/?>
<?
$evilVar 
'<script'.' language="php">echo "bla" </script>';
?>
<?ob_start
()//for multipass handler ?>

<h2>Here is a look-ahead magic. Variables calculated at the bottom are shown at the top</h2>

Here is value of variable set below: "<?=phps(2)?>=$bla;<?=phpe(2)?>"<br><br>

The number of lines below at the page is: <?=phps(1)?>=$lines<?=phpe(1)?><?=phps(1)?>$bla = 'test'<?=phpe(1)?>
<pre>
<?ob_start()/*to count lines*/ ?>
1 bla bla
2 lorem ipsum..
3 - just dots ..........
4 you can see unparsed evilVar here in the source right there: <?=$evilVar?> 
5 some stuff also here
6 you may add your lines here if you wish - they all will be counted and number printed at the top
<?$cnt=ob_get_clean(); $lines=count(explode("\n"$cnt))-1?>
<?=$cnt 
/*print the lines*/?>
</pre>
<?/*now parse code deffered for later calculation*/ ?>
<?=multipass
(ob_get_clean(), get_defined_vars())?>


Warning: file_put_contents(/home/gerkirill/domains/gerr.info/public_html/templating/tmp128371200497262.php) [function.file-put-contents]: failed to open stream: Permission denied in /home/gerkirill/domains/gerr.info/public_html/templating/templatelib.php on line 90

Warning: unlink(/home/gerkirill/domains/gerr.info/public_html/templating/tmp128371200497262.php) [function.unlink]: No such file or directory in /home/gerkirill/domains/gerr.info/public_html/templating/templatelib.php on line 94

Warning: include(/home/gerkirill/domains/gerr.info/public_html/templating/tmp128371200497262.php) [function.include]: failed to open stream: No such file or directory in /home/gerkirill/domains/gerr.info/public_html/templating/templatelib.php on line 92

Warning: include() [function.include]: Failed opening '/home/gerkirill/domains/gerr.info/public_html/templating/tmp128371200497262.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/gerkirill/domains/gerr.info/public_html/templating/templatelib.php on line 92