Error in Yii ?..

Ok I tried


if($name is a safe attribute)

from documentation, but I only get Parse error: syntax error, unexpected T_STRING in…

obviously the "is a safe attribute" is not php syntax. So how would this be valid in yii ?..

It makes more sense to have a function that looks like this: isSafe($attribute)

I still would like to know if an attribute is safe or not… any solutions?

Thanks!

That’s funny :P Ok, the solution:




if ($model->isAttributeSafe($attributeName))

{

    ...

}



http://www.yiiframework.com/doc/api/1.1/CModel#isAttributeSafe-detail