Mercurial > defr > templates
diff blog.php @ 13:673d9845fc16
Ajout d'un exemple plus complet basé sur DualBlog
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Mon, 22 Oct 2007 08:59:58 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blog.php Mon Oct 22 08:59:58 2007 +0200 @@ -0,0 +1,49 @@ +<?php + require_once('class.template.php'); + $tpl = new Template('blog_index.xml'); + $p1 = new Template('blog_post.xml'); + $p1->setParams(array( + '#post@class' => 'PostContent Weird', + 'postTitle' => 'Lorem ipsum', + 'postDate' => 'lundi 19 mars 2007, 00h37', + '#mood@src' => '/blog/mood/Weird.png', + '#mood@alt' => 'Mood: Weird', + 'postContent' => 'Lorem ipsum sit dolor amet', + 'postTags' => 'Voyage, Toulon, SNCF', + 'postNumber' => '#0002', + 'postComments'=> 'Un petit commentaire ?' + )); + $p2 = new Template('blog_post.xml'); + $p2->setParams(array( + '#post@class' => 'PostContent Cool', + 'postTitle' => 'Sit dolor', + 'postDate' => 'samedi 17 mars 2007, 00h37', + '#mood@src' => '/blog/mood/Cool.png', + '#mood@alt' => 'Mood: Cool', + 'postContent' => 'sit dolor amet', + 'postTags' => 'Voyage, Toulon, SNCF', + 'postNumber' => '#0001', + 'postComments'=> 'Un petit commentaire ?' + )); + $params = array( + 'title' => 'Dual Blog', + 'head' => array( + array( + 'link@rel' => 'StyleSheet', + 'link@href' => '/css/truc.css', + 'link@title' => 'Truc' + ), + array( + 'link@rel' => 'Alternate StyleSheet', + 'link@href' => '/css/chose.css', + 'link@title' => 'Chose' + ) + ), + '#Posts' => array( + array('post' => $p1), + array('post' => $p2) + ) + ); + $tpl->setParams($params); + echo $tpl; +?>