id = $id; foreach ($stuff as $key => $value) { $this->$key = $value; } if ($_REQUEST['thing']) { $this->doStuff(); } else { $this->dontDoStuff(); } } public function doStuff() { $this->id = $_REQUEST['thing']; echo $this->id.' corresponds to '.$this->name.', which lives in the '.$this->section; } public function dontDoStuff() { $uri = 'class.example.php'; echo "

No soup for you! id\" onclick=\"ajax('$uri', 'thing', $this->id); return false;\"> Make soup?

"; } } ?> Rate 'Some article', 'section' => 'bin', )); ?>