Mercurial > defr > templates
view blog.php @ 14:54b0a41e5564
Menu un peu plus proche d'être fonctionnel.
Il y a de fortes chances qu'au final on obtienne un fonctionnement
se rapprochant de ça. Il faudrait toutefois pouvoir definir la
valeur de noeuds fils et pas d'attributs par contre a priori.
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Mon, 22 Oct 2007 10:07:42 +0200 |
parents | 673d9845fc16 |
children |
line wrap: on
line source
<?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; ?>