Erster Stand des mvc-Frameworks
This commit is contained in:
46
rendering/Helper/Registry.php
Normal file
46
rendering/Helper/Registry.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Hilfsklasse zur Registrierung von Variablen
|
||||
*
|
||||
* @author Christian Steinle
|
||||
* @date 02.08.2016
|
||||
*
|
||||
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
|
||||
*/
|
||||
|
||||
namespace Helper;
|
||||
use Singleton\SingletonAbstract;
|
||||
|
||||
|
||||
class Registry extends SingletonAbstract
|
||||
{
|
||||
/**
|
||||
* Hält alle Registrierungsdaten fürs System
|
||||
* @var array
|
||||
*/
|
||||
private $data = array();
|
||||
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
{
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
if (array_key_exists($name, $this->data))
|
||||
{
|
||||
return $this->data[$name];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user