Mhh ja dann müsste ich aber jedesmal wenn ich auf ein all Att zugreifen will $this->all->att schreiben. Ich habe in der Zwischenzeit nochmal etwas rumgewerkelt und die jetzige Lösung scheint zu funktionieren, auch wenn man sie vom Codebild her sicherlich noch verschönern kann(die Arrayübergabe gefällt mir so noch nicht ganz).
Index
ob_start();
include "all_class.php";
include "db_class.php";
include "form_class.php";
include "navi_class.php";
include "display_class.php";
include "admin_class.php";
include "news_class.php";
session_start();
$_SESSION['all'] = new All;
$_SESSION['db'] = new DB;
$_SESSION['form'] = new Form;
$_SESSION['navi'] = new Navi;
$_SESSION['display'] = new Display;
$_SESSION['admin'] = new Admin;
$_SESSION['news'] = new News;
$att =& $_SESSION['all']->att();//returns refernce on the attributes of class all
$_SESSION['form']->synchronize(&$att);//gives every attribute that is also part of class all the reference of the all attribute
$_SESSION['navi']->synchronize(&$att);
$_SESSION['display']->synchronize(&$att);
$_SESSION['admin']->synchronize(&$att);
$_SESSION['news']->synchronize(&$att);
$_SESSION['all']->start();
ob_end_flush();
class All
function att(){
$this->db =& $_SESSION['db'];
$this->form =& $_SESSION['form'];
$this->navi =& $_SESSION['navi'];
$this->display =& $_SESSION['display'];
$this->admin =& $_SESSION['admin'];
$this->news =& $_SESSION['news'];
$att = array(
&$this->baseurl,
&$this->cookieallow,
&$this->db,
&$this->form,
&$this->navi,
&$this->display,
&$this->admin,
&$this->news
);
return $att;
}
function synchronize(&$att){
$this->baseurl =& $att[0];
$this->cookieallow =& $att[1];
$this->db =& $att[2];
$this->form =& $att[3];
$this->navi =& $att[4];
$this->display =& $att[5];
$this->admin =& $att[6];
$this->news =& $att[7];
}
function start(){
$this->db->connect();
$this->display->showbegin();
$this->display->showhead();
$this->display->showtop();
$this->display->shownavi();
$this->display->showright();
$this->display->showcontent();
$this->display->showfooter();
$this->display->showend();
}