Use .phtml extension for view files

I’d like to use .phtml files as view files, this would make a clearer distinction between view (template) files and php logic. Is there an easy way to configure this?

Getting the view filename from functions like render() or renderPartial() is done in: CController->resolveViewFile()


You can probably just override this method in your base Controller.

We just need to change $extension=’.php’; to $extension=’.phtml’; ?