Zend framework Getting a controller to use another viewer

I am using Zend Framework.

I have a controller called UserController that has a public displayAction () function.

I would like to know how I can get this action method to use a different viewer than the default display.phtml by default.

Any help is appreciated.

+5
source share
2 answers

you can use

$this->render('actionName');

or alternatively you can invoke the script view directly by calling

$this->renderScript('path/to/viewscript.phtml');

http://framework.zend.com/manual/en/zend.controller.actionhelpers.html, render() renderScript().

+17

, ( ZF 1.11.11). :

$this->_helper->viewRenderer('action');
+1

All Articles