File exists


Is Yiis CFileHelper::validateFile() the same as PHPs file_exists? Is it used for the same purposes or is it fundamentally different?

Also is there a file_exists in Yii?

I need to check if an image file exists for my user profiles (user photo) etc. And if it exists display the image. Thats the purpose of this question.


Unless this is new to v1.1.7 CFileHelper doesn’t have a validateFile() method, it has a validatePath() method.

What’s wrong with using PHP’s file_exists function?

You could just use the file_exists function aswell

Yea I will use file_exists