Since Tomas Feifar explained how it works $this->layout()->content. However, the interesting thing is that “content” is not just a variable in the layout. In fact, "content" is the key in the replacement view of the form "Zend_Layout". For this reason, the following snippets are equivalent echo $this->layout()->contentin your layout.phtml:
$placeHolder = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer('Zend_Layout');
echo $placeHolder['content'];
echo $this->placeholder('Zend_Layout');
echo $this->placeholder('Zend_Layout')->content;
. , layout.phtml, Zend_Layout. , , layout.phtml . , layout.phtml, :
<div id="footer">
<?php echo $this->layout()->myFooterText; ?>
</div>
, . Bootstrap.php. , , :
$this->view->placeholder('Zend_Layout')->myFooterText = 'Some text only for this action';
, . , , $this->view->placeholder('Zend_Layout') Zend_View_Helper_Placeholder_Container, Zend_Layout placeholder.
EDIT:
"" . - , setContentKey Zend_Layout, :
protected function _initSetNewLayoutContentKey() {
$layout = $this->bootstrap('layout')->getResource('layout');
$layout->setContentKey('viewoutput');
}
layout.phtml echo $this->layout()->viewoutput; echo $this->layout()->content;.