Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class output{
- public $data=array();
- function __construct__(){
- }
- function setSomething(){
- $this->data[] = 'frog';
- }
- }
- class template{
- function __construct__(&$output){
- $this->output = $output;
- }
- function myFunction(){
- print_r($this->output->data;)
- }
- }
- $output = new output();
- $template = new template($output);
- // What I had added: $template->output = $output; <=== STUPID
- $output->setSomething();
- $template->myFunction();
Add Comment
Please, Sign In to add comment