Class 'app\controllers\Yii' not found when calling render in a controller


I am getting Class ‘app\controllers\Yii’ not found when rendering a view in my controller:

 return $this->render('@app/views/profile/profilephoto');

is the line that is causing the error so I don’t understand where the problem is?

Move your post here: [color="#4169E1"][/color] or here: [color="#00BFFF"][/color]

[color="#006400"]/* moved */[/color]

Thanks for moving it!!!!

Commun: what controller are you using that code in?

If you are in the profile controller,then you only need to do:

return $this->render('profilephoto');

If you are in a different controller, then this will do it:

return $this->render('/profile/profilephoto');

You need to read the guide:

Thanks for your support because they lead me to detect the error;I’ve arranged my code following above instructions.

The problem was I was using


instead of


in my code of view; so missing that anti-slash was causing the error. It is working perfectly.

Thanks again!!!!

Where can I change the status of post(putting it to solved)?