Change the .phtml extension in Zend Framework (module only)

The standard extension for template files in the Zend Framework is -.phtml ... I need to change them to .js in one specific module ... can someone help ... I would ideally like to change this controller level ...

Many thanks...

+3
source share
1 answer

In your controller:

public function init() {
    $this->getHelper('viewRenderer')->setViewSuffix('js');
}

If you need to apply this to all the controllers inside a module, you must put it in the abstract controller class used for this module, and each of the modules in this module inherits from this abstract class.

, 'js' , , . , , .

init(), , , .

+6

Source: https://habr.com/ru/post/1744611/


All Articles