2014-09-23 129 views
0

我正嘗試在ZF1創建佈局佈局在Zend框架1

的application.ini

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" 
resources.layout.layout = "default" 

bootstrap.php中

protected function _initView() 
{ 
    $this->bootstrap('layout'); 
    $layout = $this->getResource('layout'); 
    $view = $layout->getView(); 
    $view->headTitle('default title'); 
    return $view; 
} 

和我有兩個模塊(家庭和測試)「默認」佈局在家中工作,但沒有在測試中(兩者都是平等的,只是這樣做來學習ZF1) 我應該做一些不同的事情來爲我的所有模塊設置默認佈局嗎?

以防萬一你需要它。這是模塊/測試代碼/ IndexController.php

<?php 

class Test_IndexController extends Zend_Controller_Action 
{ 

    public function init() 
    { 
     /* Initialize action controller here */ 
    } 

    public function indexAction() 
    { 

    } 

} 

,這是模塊/測試/視圖/腳本代碼/ index.phtml

Hello, this is the test module 

請讓我知道如果你需要更多信息。謝謝

回答

0

這不是佈局問題。這是一個代碼問題。