I am newbie to class and objects.Here I am making an application for invoice.So for the controllers as in the frameworks I have taken them as handlers.So for the UserHandler I
You can create a static class using magic methods __get and __set to the the values like:
class Data {
public static $atributos = array();
public function __get($chave) {
return array_key_exists($chave, $this->atributos) ? $this->atributos[$chave] : NULL;
}
public function __set($chave, $valor) {
$this->atributos[$chave] = $valor;
}
}
To set a value, you use: Data::__set('view_data', $my_var);
On the view you just do: Data::__get('view_data');
I think it will work =)