Zend Framework switching views in action -


i have action in controller supposed display different types of output depending on value in dropdown on form.

i have written templater object (extends zend_view_abstract) different view types.

i have tried running following code:

public function generatedocumentaction() {     //...some code set $view depending on post data             // e.g. $view = new templaterodt(); //view openoffice document      $this->_helpers->gethelper('viewrenderer')->setview($view);      $this->view->myvar = $form->getvalue('some_value'); } 

but $this->view still default 1 (a smarty templater) which set in /public/index.php

i've looked in documentation , says can set view in init() function in controller http://framework.zend.com/manual/en/zend.view.scripts.html set view entire controller don't want.

how can change output type action?

if want change template rendered, use:

$this->_helper->viewrenderer('viewscripthere'); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -