开发者

How do i use zend_layout in boostrap

开发者 https://www.devze.com 2023-03-15 00:46 出处:网络
I am beginner.I have the following div structure in zend layout.phtml <div id=\'outer\'>//start outer

I am beginner.I have the following div structure in zend layout.phtml

<div id='outer'>//start outer
<div id='header'>//start header......</div>// end header
<div id='content'>//start content......</div>// end content
<div id='footer'>//start footer......</div>// end footer
</div>// end outer 

Here i want to separate the page like heade开发者_开发问答r.phtml for header part and footer.phtml for footer part. How can i use zend_layout in bootsrap file for the above structure


Add this line to your bootstrap file:

Zend_Layout::startMvc(array('layoutPath' => 'PATH TO YOUR LAYOUT DIRECTORY'));

EDIT:

To separate header and footer in distinct files use this code:

<div id='outer'>//start outer
    <?php echo $this->render('header.phtml'); ?>
    <?php echo $this->render('content.phtml'); ?>
    <?php echo $this->render('footer.phtml'); ?>
</div>// end outer 


If I understand you want to fill these DIVs with their respective content contained in different files. You can do it in view something like this:

<div id='outer'>
   <div id='header'><?= $this->render('header.phtml'); ?></div>
   <div id='content'><?= $this->render('content.phtml'); ?></div>
   <div id='footer'><?= $this->render('footer.phtml'); ?></div>
</div>

Here you can manage header.phtml, content.phtml and footer.phtml separately.

0

精彩评论

暂无评论...
验证码 换一张
取 消