Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-11-2008, 09:44 PM
Junior Member
 
Join Date: Aug 2008
Posts: 1
Lightbulb Post and PreDispatch

I am trying to setup my indexcontroller so that the header and footer are automatically displayed around the body content

I thought using pre and postdispatch methods would be the best option

i.e


PHP Code:
function preDispatch()
        {
            echo 
$this->view->render('header.phtml');
        }
        
        function 
postDispatch()
        {
            
            echo 
$this->view->render('footer.phtml');
        }
    
        function 
indexAction()
        {
            
        } 
I presumed that the ouput would be in this format

header.phtml content : index.phtml | (equiv Action) content : footer.phtml content

HOWEVER!!!!

It turned out like this!!!

index.phtml | (equiv Action) : header.phtml content : footer.phtml content

Can you explain why?

More importantly can you explain what is the best way to achieve my request?

Thanks in advance,
__________________
http://irishradioportal.comtrying to use zend frame work
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-11-2008, 10:09 PM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 122
Default

The mvc is encapsulated with an output buffer. It can be disabled with a FC param; however, you should be using zend_layout instead as it provides far more capability than the split header/footer method.
__________________
Zym Framework - A Zend Framework extension library w/ demo app

SpotSec Blog:
http://spotsec.com/blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:39 PM.