2008年7月31日星期四

[fw-mvc] Proper way to change view script within controller action?

Hi,

just a quick question to make sure. Within a controller action called
showAction I would like to change the script depending on the current
design. So I would like to change it from 'show.phtml' to 'show1.phtml',
'show2.phtml' or 'show3.phtml'. What is the proper way to change the
view script within a controller action?

In the manual I found this section, which uses render():
http://framework.zend.com/manual/en/zend.controller.action.html#zend.controller.action.viewintegration.render

I guess that this render() method should be called at the end of the
showAction method of the controller to make sure that all stuff is done
within showAction.

Or is there another way just to change the view script name without
calling the render() method and let the View Renderer do the job?

Best regards,

Ralf

没有评论: