2014-09-02 38 views
0

我需要使用zend框架2在我的定製幫助程序中獲取佈局。 我該怎麼做?如何從zf2定製幫助程序中獲得佈局

class CategoryHelper extends AbstractHelper 
{ 

    public function getCatMenu(){ 
     $this->getView()->layout(); //this not works, how can i get view's layout 
    } 

} 
+0

我認爲你需要詳細說明*爲什麼*您需要的佈局。什麼是最終目標? – AlexP 2014-09-02 18:33:21

+0

,因爲我的佈局將「all_categories」數組作爲變量($ layout-> cats)。我需要每一頁。 – Yargicx 2014-09-02 19:01:24

+0

如果你在「每一個」頁面中需要它,我會繼續並將這些添加到module.php onBootstrap方法中的佈局。 – cptnk 2014-09-03 07:05:06

回答