I have found the answer here:
The Scope Resolution Operator (also called Paamayim Nekudotayim) or in
simpler terms, the double colon, is a token that allows access to
static, constant, and overridden properties or methods of a class.
When referencing these items from outside the class definition, use
the name of the class.
As of PHP 5.3.0, it’s possible to reference the class using a
variable. The variable’s value can not be a keyword (e.g. self, parent
Basically, I had to upgrade the PHP version to be able to reference a class dynamically.
Actually, you don’t have to upgrade to reference the class dynamically. Yii does it without and yii supports PHP 5.2. If you are interested, I can see if I can dig up how it is done, but I’ve run into the same problem and resolved it on PHP 5.2
Ok, here’s the info. I posted the original info on a Yii wiki page.
Here’s the code that returns a Yii singleton model:
$thisModel = call_user_func($modelname, 'model');
But, per DCoder, it looks like
CActiveRecord::model($modelname) will also work:
Yii info here: http://www.yiiframework.com/doc/api/1.1/CActiveRecord#model-detail