28 lines
452 B
PHP
Executable File
28 lines
452 B
PHP
Executable File
<?php
|
|
|
|
abstract class Controller {
|
|
|
|
protected function __construct () {
|
|
|
|
if ( empty($_SESSION[get_called_class()]) )
|
|
$_SESSION[get_called_class()] = array();
|
|
|
|
}
|
|
|
|
protected function store ( $key, $value ) {
|
|
|
|
$_SESSION[get_called_class()][$key] = $value;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
protected function restore ( $key ) {
|
|
|
|
return !empty($_SESSION[get_called_class()][$key]) ? $_SESSION[get_called_class()][$key] : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|