Symfony 1.4 Layout footer glitch: Footer div is echoed out with $sf_content

Posted by Parijat Kalia on Stack Overflow See other posts from Stack Overflow or by Parijat Kalia
Published on 2012-11-25T01:00:52Z Indexed on 2012/11/25 23:04 UTC
Read the original article Hit count: 384

Filed under:
|
|
|
|

I have a very simple Layout for my application. A header, the main content, and a footer. Semantically, they are rendered like this:

<body>
<div id = "header"> </div>
<div id = "content"> </div>
<div id = "footer"> </div>
</body>

The corresponding CSS is very basic as well:

#header{
width:100%;
min-height:10%;
}
#center{
width:100%;
min-height:80%;
}
#footer{
width:100%;
min-height:10%:
}

As you would know in the layout page, here is how the content is rendered:

<div id= "content">
<?php echo $sf_content; ?> 
</div>

All of the above is very fine and it renders itself as it is supposed to. But there is a glitch with this, the moment i put in <?php echo $sf_content; ?> the footer is included as part of the content and not as a div that is after the #content markup.

Essentially, I get this:

<div id = "header"></div>
<div id = "content>
   <div id ="symfony_template_to_be_rendered">
    <!-- all web application related content like forms etc. -->
   </div>
   <div id = "footer">Footer material
   </div>
</div>

As you can see, for some weird reason, the footer moved up along with the symfony content. Clearly this is a glitch because if I remove the php hash $sf_content part from the div tags in my layouts, then the footer renders itself as and where it should be and everything takes up the required dimensions.

What's going on here?

© Stack Overflow or respective owner

Related posts about html

Related posts about css