KumbiaPHP beta2-dev
Framework PHP en español
|
00001 <?php 00023 class Registry 00024 { 00030 private static $registry = array(); 00031 00038 public static function set($index, $value) 00039 { 00040 self::$registry[$index] = $value; 00041 } 00042 00049 public static function append($index, $value) 00050 { 00051 if(!isset(self::$registry[$index])){ 00052 self::$registry[$index] = array(); 00053 } 00054 self::$registry[$index][] = $value; 00055 } 00056 00057 00065 public static function prepend($index, $value) 00066 { 00067 if(!isset(self::$registry[$index])){ 00068 self::$registry[$index] = array(); 00069 } 00070 array_unshift(self::$registry[$index], $value); 00071 } 00072 00079 public static function get($index) 00080 { 00081 if(isset(self::$registry[$index])){ 00082 return self::$registry[$index]; 00083 } else { 00084 return null; 00085 } 00086 } 00087 00088 }