Anynchootte
New Member
Here's what I want to do:\[code\]public function all($model) { $query = 'SELECT ' . implode(', ', $model::$fields) ....;}\[/code\]Called like this:\[code\]$thing->all(Account);\[/code\]I get this error:\[code\]Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/mark/public_html/*/account.php on line 15\[/code\]When inspecting \[code\]$model\[/code\] with \[code\]var_dump\[/code\] it turns out its a string. In the the first example if I change \[code\]$model\[/code\] to \[code\]Account\[/code\] on the $query line it works fine.How can a take a string and turn it back into a class?Edit: Updated example and title to reflect the problem isn't with \[code\]self\[/code\].Solution: Since I'm not using PHP5.3, I had to resort to using eval() to get what I wanted. Thanks everybody!