Mercurial > defr > DualBlog
comparison includes/class.factory.php @ 11:ff57b45eda37
Changement profond de l'index. Utilisation des templates.
Dual Blog utilise maintenant intimement la libraire de templates
que l'on peut trouver sur http://hg.defr.org/defr/templates,
ce qui permet d'eviter de mixer du code PHP avec du HTML.
Accessoirement, on est aussi assurer d'avoir du XML valide,
puisque c'est l'API DOM qui est utilisée pour générer la
sortie.
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Wed, 24 Oct 2007 20:06:00 +0200 |
parents | |
children | bdf116822fc6 |
comparison
equal
deleted
inserted
replaced
10:8f1125d27079 | 11:ff57b45eda37 |
---|---|
1 <?php | |
2 class Factory { | |
3 private static $db = null; | |
4 private static $mainTemplate = null; | |
5 private static $skeleton = null; | |
6 | |
7 public static function getDB() { | |
8 if(is_null(Factory::$db)) | |
9 Factory::$db = new DataAccess(); | |
10 return Factory::$db; | |
11 } | |
12 | |
13 public static function getSkeleton() { | |
14 if(is_null(Factory::$skeleton)) | |
15 Factory::$skeleton = new Skeleton(); | |
16 return Factory::$skeleton; | |
17 } | |
18 } | |
19 |