Najam-us-Saqib
Najam-us-Saqib

Reputation: 534

Pass a variable from an action to another action's view in ZF

I want to know that does zend allow this thing and if yes than how?

public xAction()
{
// code here
}

public yAction(){
 $this->_helper->viewRenderer('x');
// code here....
// $this->view->variable= $somedata;
}

**x.phtml**

<?php echo $this->variable; ?>

Upvotes: 0

Views: 82

Answers (1)

undefined
undefined

Reputation: 2101

Zend allows the rendering of a different view script. You can do it like this: $this->_helper->viewRenderer('controller/action', null, true);
More info here (Example #11)

Upvotes: 1

Related Questions