I see that widgets have good view rendering support, but I found that I can not render views inside of my extension (I'm creating an email extension). This was the only way I could render a view:
Yii::app()->controller->renderPartial(…)
But the problem is that is will only look for views in the 'application.views' directory, not in application.components.views as I would like and seems to make more sense
The reason I want my email extension (or would you call it a component? should it extend CApplicationComponent as it does now?) to render a view is that the extension can be put into a 'debug' mode, in which the extension outputs the email to the layout (so I would like to take use of a view) instead of actually emailing it.
I would also like the extension to support using views as the email content, and even layouts, as CakePHP does.
I think we probably can allow using path alias to specify a view. For example, Yii::app()->controller->render('@application.extensions.email.views.registration') would translate to rendering the view file 'protected/extensions/email/views/registration.php'.
To make the path alias shorter, a new alias can be defined by using render(). For example,