Advertisement
wandrake

Untitled

Mar 1st, 2012
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. class Index {
  2.     private static $_elements = array();
  3.     private static $_idx = 0;
  4.    
  5.     private static $_prefix = ".";
  6.    
  7.     private static function add($element) {
  8.         self::$_elements[self::$_idx] = $element;
  9.         self::$_idx++;
  10.     }
  11.    
  12.     public static function initialize() {
  13.         $banner = new Banner(self::$_prefix);
  14.         self::add($banner);
  15.     }
  16.    
  17.     static public function show() {
  18.         for ($i = 0; $i < self::$_idx; $i++) {
  19.             self::$_elements[$i]->show();
  20.         }
  21.     }
  22. }
  23.  
  24. Index::initialize();
  25. Index::show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement