What is the file exactly? It seems like a strange way to process the output.
[s]In any case, I imagine you could turn output buffering on and capture the output.
Can you explain in more detail what you’re trying to do? There may be a better way to handle it.[/s]
EDIT: I see you’ve already thought of that. I’m not sure that there’s a Yii specific way to do it, but you could create a helper method for your own application.
Your last post implies that you are rather looking for partial views. For the record: Yii makes some use of returning data from an included file, so an assignment like $content=include($file); can work. Application configs work that way.
You should be able to use renderPartial in themes without problems. render() and renderPartial() take a third argument that controls wether the rendering result should be displayed or rather returned. See CController.renderPartial().