php error: Indirect modification of overloaded property class::$data has no effect

133 Views Asked by At

I have this sample code from my default function of the controller class.

$this->data['heading_title']= $this->language->get('heading_title');

$this->data['text_enabled'] = $this->language->get('text_enabled');

when i run the code it just keeps on giving me this error

Indirect modification of overloaded property ControllerModuleHelloworld::$data has no effect in /the/path/of/the/file

When looking at some of the previous answers here, it seems that mostly is about calling by reference. but whenever I try it using this code

&_set( $this->data['heading_title'], $this->language->get('heading_title') );

it returns this error:

Parse error: syntax error, unexpected '&' in /the/path/of/the/file.php on line 23

Can you please assist me in order to know what's wrong and how to fix the bug.

0

There are 0 best solutions below