mymotherland
mymotherland

Reputation: 8226

How do i use zend_layout in boostrap

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 header.phtml for header part and footer.phtml for footer part. How can i use zend_layout in bootsrap file for the above structure

Upvotes: 0

Views: 142

Answers (2)

Naveed
Naveed

Reputation: 42093

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.

Upvotes: 1

rahim asgari
rahim asgari

Reputation: 12437

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 

Upvotes: 1

Related Questions