Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Checking if view exists?

$
0
0
Is there a quick, easy method to check, if view exists?

I'm doing something like that in my widget:

if(isset($item['view']) && $item['view'] != '')
    	echo($this->controller->renderPartial($item['view'], NULL, true));
else
    	echo('Error: Property mode is set to view, but no view (property view) is provided!');

Code properly reacts on user-specified view being empty or not set, but fails with exception, when provided view file is not existing. I want to avoid that. How can I do this?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>