I read the php.net documentation, but I still can't figure out how to make it work this way.
My current code:
Code: Select all
class page {
var $vars = array ();
//#################################
//## { output - output page
function output () {
// initiate parser with a reference to $vars
$parser = new parser (&$vars);
} ## } output
//#################################
}
class parser {
var $data = array ();
//#################################
//## { construct
function parser (&$data_origin) {
// $data should refer to $vars in the page class
$data = &$data_origin;
// return success
return true;
} ## } construct
//#################################
}Edit: changed to [ code ] as [ php ] wasn't working.
Edit2: Wouldn't work either, back to [ php ] then.