Convention over configuration: Use the action name as a possible view name

Hello,

I started a couple of weeks ago with Yii and I quite like it.

One thing I did not find but know from Grails is the convention described in the topic. Would it be possible that the render method uses reflection to find out the name of the calling action and looks up if a view under 'views/<controllername>/<name_of_action' exist. Then one only had to pass the parameters and does not need to give the name of the view.

I have to admit that I don't know if PHP is capable of doing this kind of introspection.

All the best,

Ramon

This is certainly feasible to implement. However, this would add more magic to the code and make the code harder to understand and maintain.

If you like, you can always implement this in your base controller.

i agree with this feature that is present in most frameworks. I think it is best to have this default and then whenever anyone wants can explicitely name the view file to render