Cfile extension in view

hi guys

I’m working today with a new extension Cfile, and i want to use it in the view like below




Yii::import('application.extensions.file.CFile');


if (CFile::set($path')->exist){

    ?> 

<p><img src="<?php echo $path; ?>" height="100" width="100" />

    <?php 


}

else{

    ?> 

<p><img src="/images/user/unknown-person.jpg'; ?>" height="100" width="100" />

    <?php

}



I got this error




Property "CFile.exist" is not defined. 



i think i need to do the “if else” in a controller, but i don’t know how can someone help me.

thank you very much

You’re trying


CFile::set($path)->exist

without ‘s’ in the ‘exist’, the correct is ‘exists’

Happy coding.

yes awesome.

Thank you very much, that was stupid from my side.