2009-07-15 56 views
0

我該如何創建類似於:$ this-> layout() - > sidebar,我嘗試了大約4個小時......但它對我不起作用!您能否給我一個例子?Zend Framework的Zend_Layout問題

+0

你的目的不明確。你最終的目標是什麼? – 2009-07-15 19:03:59

回答

1

我還不確定你想要做什麼 - 但也許這個代碼,我正在使用將有所幫助。

// setup the info column into the placeholder 
$this->placeholder('rightcol') 
    ->set($this->render('index/view_infoCol.phtml')); 

// later in the layout template 
echo $this->placeholder('rightcol'); 
0

使用setResponseSegment( '側邊欄'),在您控制器使$這個 - >佈局() - >側邊欄工作...

0

您可以使用此:

在你的控制器:

$this->_response->insert('sidebar', $this->view->render('sidebar.phtml')); 

在您的佈局:

<?=$this->layout()->sidebar;?>