SyntaxFix
Write A Post
Hire A Developer
Questions
To access a variable in a class, you must use $this->myVar instead of $this->$myvar.
$this->myVar
$this->$myvar
And, you should use access identifier to declare a variable instead of var.
var
Please read the doc here.