Render and return boolean

Is there a way so that when a view file doesn’t exists, and using render/renderPartial to return a boolean false instead of throwing an error ?

I have a theme system, and if the view file doesn’t exists in the current theme or module views then i need to load the view file from the default theme.

Try to override CController::getViewFile() method with a custom implementation in your Controller class.

public function getViewFile($viewName)


	if ($viewFile = parent::getViewFile($viewName)) {

		return $viewFile;

	} else {

		// code that returns the path to the view file from the default theme



Thanks, i believe this is what i need.