0
<?php
class cms{
private $dataset;
private $columns;
private $configs;
public function __construct(){
global $frw, $dbg;
$this->configs =array();
}
public function __get($key){
if(array_key_exists($key, $this->configs)==true){
return $this->configs[$key];
}else{
throw new Exception('Unable to get value from configuration. '.$key);
}
}
public function __set($key, $value){
if(array_key_exists($key,$this->configs)){
throw new Exception('Unable to set configuration. '.$key);
}else{
$this->configs[$key] = $value;
}
}
public function exists($key){
if(isset($this->configs[$key])){
return true;
}else{
return false;
}
}
public function load(){
}
}
?>
$ CMS =新的$釐米;
我需要在頁面上設置一個變量來設置對象,並且在整個頁面(對於會話持續時間)內全局可用。我不想要會話變量,我不想使用全局變量。有沒有辦法在頁面之間傳遞$ dataset,並在xajax負載中調用$ cms-> dataset。我一直在想,我應該能夠設置一個變量$dataset = $cms->__get('dataset');