Re: templating engine options

From: Date: Tue, 26 May 2009 00:48:41 +0000
Subject: Re: templating engine options
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-293150@lists.php.net to get a copy of this message
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

« previous php.general (#293150) next »