class.flatblog.php
// Render the template as Pure HTML, replacing the appropriate tags. //
Render the template as Pure HTML, replacing the appropriate tags.
Render the template as Pure HTML replacing the appropriate tags .
private function renderPostTemplate() {
		$posts = $this->getPosts();
		$renderedposts = array();
		foreach($posts as $post) { 
			$post_template = file_get_contents('post.html');
			$title = $post['title'];
			$author = $post['author'];
			$postdate = $post['postdate'];
			$text = $post['text'];
			$text = nl2br($text);
			$post_template = str_replace("{{title}}", $title, $post_template);
			$post_template = str_replace("{{author}}", $author, $post_template);
			$post_template = str_replace("{{date}}", $postdate, $post_template);
			$post_template = str_replace("{{text}}", $text, $post_template);
			array_push($renderedposts, $post_template);
		}
		return $renderedposts;
	}
private function renderPostTemplate ( ) { $ posts = $ this -> getPosts ( ) ; $ renderedposts = array ( ) ; foreach ( $ posts as $ post ) { $ post_template = file_get_contents ( 'post.html' ) ; $ title = $ post [ 'title' ] ; $ author = $ post [ 'author' ] ; $ postdate = $ post [ 'postdate' ] ; $ text = $ post [ 'text' ] ; $ text = nl2br ( $ text ) ; $ post_template = str_replace ( " {{title}} " , $ title , $ post_template ) ; $ post_template = str_replace ( " {{author}} " , $ author , $ post_template ) ; $ post_template = str_replace ( " {{date}} " , $ postdate , $ post_template ) ; $ post_template = str_replace ( " {{text}} " , $ text , $ post_template ) ; array_push ( $ renderedposts , $ post_template ) ; } return $ renderedposts ; }
Render the template as Pure HTML, replacing the appropriate tags.
Render the template as Pure HTML replacing the appropriate tags .