Re: templating engine options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sancar Saran wrote:
<?php
$content = 'No Comments';
if(isset($comments) and is_array($comments) and count($comments) > 0 ) {
	$content = '';
	foreach( $comments as $index => $comment ) : $content. = "<a href='".
$comment->link."'>".$comment->title."</a>"; endforeach;
}
?>

<h2>Comments</h2>
<div id="comments">
	<?=$content?>
</div>

index.php
ob_start();
require('template.php');
echo ob_get_clean();


I'm still do not understand for complex template system requirement.

I just _need_ the two abstracted.

php must have no html in it
html template must contain no php

Why it have to be very complex system.

Large data array, some conditions, lots of loops, and What else ?

http://www.flytag.de/
http://urlaub-finder.de/
http://airportdirekt.de/

All same system. With different css designs.

yup, did this myself for a longgggg time; here is some very old code I used to use!

newCage();
$content = cage(include $file);
	
function newCage() {
	ob_start();
}
function cage() {
	$includeOutput = ob_get_contents();
	ob_end_clean();
	return $includeOutput;
}

lol

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux