views:

35

answers:

1

In Zend Framework we can change the file extension of view files from phtml to php by adding following code to controller.

$this->getHelper('viewRenderer')->setViewSuffix('php');

But how to change the file extension for layout files?

+1  A: 

Untested, but likely through

Try

$this->getHelper('layout')->getLayoutInstance()->setViewSuffix('php');

You can also try

Zend_Layout::getMvcInstance()->setViewSuffix('php');

There is also Zend_Application_Resource_Layout, so you can likely setup the viewSuffix from your application.ini as well when using Zend_Application, e.g. something like

resources.layout.viewSuffix = php;
Gordon
Thanks, $this->getHelper('layout')->setViewSuffix('php'); it worked for me.
Imran Naqvi