Don't Use The "content" Div At Some Views

Hi,

I have a problem. Yii can’t put the at some views the <div id=“container”>, it is absolutely missing! But at other it works well!

These HTML codes sometime miss, and I don’t know why…


<div class="container">

	<div class="span-19">

		<div id="content">

			

                <h1>Manage Products</h1>

                ....

               </div>

...

The layouts file is okay, because at other views, I can see these divs and the browser use the padding, but at some views, I can’t see these HTML tags, and there aren’t any paddings around my content.

Yes, the above HTML codes is absolutely missing.

I don’t understand why.

Most likely it’s a mistake you have done in some of your code. Does it always happen at the same views or is it perhaps all the view files related to a certain controller? If so, it would be a help to us if you would post something of that code.

Sounds like you’re trying to load resources without a defined base url.

Make sure that the resources loaded in your layout go like this…

Load from theme css folder:


<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/some-css.css" />

Load from webroot css folder:


<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/css/some-css.css" />

Note the path to your file starts something like this:


href="<?php echo Yii::app()->baseUrl; ?>...

That’s assuming I understand your comments correctly, because it appears that the content is there, just styled incorrectly.