KumbiaPHP  beta2
Framework PHP
 Todo Estructuras de Datos Namespaces Archivos Funciones Variables Páginas
registry.php
Ir a la documentación de este archivo.
1 <?php
34 class Registry
35 {
36 
42  private static $registry = array();
43 
50  public static function set($index, $value)
51  {
52  self::$registry[$index] = $value;
53  }
54 
61  public static function append($index, $value)
62  {
63  if (!isset(self::$registry[$index])) {
64  self::$registry[$index] = array();
65  }
66  self::$registry[$index][] = $value;
67  }
68 
75  public static function prepend($index, $value)
76  {
77  if (!isset(self::$registry[$index])) {
78  self::$registry[$index] = array();
79  }
80  array_unshift(self::$registry[$index], $value);
81  }
82 
89  public static function get($index)
90  {
91  if (isset(self::$registry[$index])) {
92  return self::$registry[$index];
93  } else {
94  return null;
95  }
96  }
97 
98 }