Ifrit_Prog
Ifrit_Prog

Reputation: 1

ZF 1.12.X - Render View inside View

I would understand if there is a way to render a View of any Action inner a general View, like layout.

For example, i construct this action:

...
public function fooAction(){
   ...
}
...

i want render the associate phtml (script/foo.phtml) inside another phtml, like this workflow:

Zend_Layout: [file: layout.phtml]
<bla bla bla>
<?= $this->layout()->content // here  render bug.phtml
?>
</bla bla blas>

----------------------------
Zend_View (my external custom view) [file: bug.phtml]
<div>
Bla bla bla <?= $this->data[0]?>
</div>
<aaaa>
<?= $this->ActionView->render() // here render foo.phtml
?>
</aaa>

----------------------------
Zend_View (standard action view) [file: foo.phtml]
<bbbbb>
<?= $this->data[0];?>
<?= $this->data[1];?>
etc etc...
</bbbb>

is possible make that?

Upvotes: 0

Views: 433

Answers (1)

homelessDevOps
homelessDevOps

Reputation: 20726

Just call:

<?= $this->render('foo.phtml'); ?>

Upvotes: 2

Related Questions