zendframework基础教程之layout

讲完最基础的操作现在来说一下zend 的布局即layout

Zend 的layout很灵活:

在入口文件设置一下你的layout路径

//设置layout路径

Zend_Layout::startMVC(array('layoutPath'=>'./application/views/layout/'));

//然后在控制器的index中写入

$this->_helper->layout->setLayout('default'); //这里设置了你的布局,如果不设置则默认为layout.phtml

然后你要在你设置的layout目录下写入你的布局(包括header.phtml,footer.phtml,defalut.phtml).

 

http://hi.baidu.com/zxl_web/item/45ba41ac6236f235020a4de5

猜你喜欢

转载自hnlixf.iteye.com/blog/1905956