0

我会理解是否有办法将任何动作的视图呈现在一般视图中,比如布局。

例如,我构造了这个动作:

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

我想在另一个 phtml 中呈现关联的 phtml (script/foo.phtml),就像这个工作流:

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>

有可能做到吗?

4

1 回答 1

2

只需致电:

<?= $this->render('foo.phtml'); ?>
于 2013-10-05T09:02:40.073 回答