Advertisement
wandrake

Untitled

Mar 1st, 2012
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.     require_once("$prefix/include/dbconnect.php");
  3.     require_once("$prefix/pages/Home2.php");
  4.     require_once("$prefix/include/Utils.php");
  5.     require_once("$prefix/include/Banner.php");
  6.  
  7.     require_once("$prefix/utils/Div.php");
  8.  
  9.     class Index {
  10.         private static $_elements = array();
  11.         private static $_idx = 0;
  12.        
  13.         private static $_prefix = ".";
  14.        
  15.         private static function add($element) {
  16.             self::$_elements[self::$_idx] = $element;
  17.             self::$_idx++;
  18.         }
  19.        
  20.         public static function initialize() {
  21.             $wrapper = new Div("wrapper");
  22.             $wrapper->add(new Banner(self::$_prefix));
  23.             $wrapper->add(new Home(self::$_prefix));
  24.            
  25.             self::add($wrapper);
  26.         }
  27.        
  28.         static public function html() {
  29.             $ret = "";
  30.            
  31.             for ($i = 0; $i < self::$_idx; $i++) {
  32.                 $ret .= self::$_elements[$i]->html();
  33.             }
  34.            
  35.             return $ret;
  36.         }
  37.        
  38.         static public function show() {
  39.             echo self::html();
  40.         }
  41.     }
  42.    
  43.     Index::initialize();
  44.     Index::show();
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement