Why all contents that should be in the <head> is included in the <body>?

It’s really awkward isn’t it. Is there anything wrong with my configuration?

How to solve it?


See the attachment picture if the picture above fails to load

Check your protected/view/layouts/main.php…

I think there’s no problem with main.php. 'Cause all that content included in the <body> tag comes from the main.php.

See the attachment if you want to verify that.

Yii wouldn’t be moving the content out of the “<head>” section into the “<body>” section, so it must be in one of your layout files. Are you using a different theme to the default? And make sure you’re referencing the correct layout files from your code.

Well, I didn’t change anything except I changed the $layout to be ‘column1’ and used another CSS file, should these actions supposed to be the reason?

Strange… In your first post picture… below the <body> there is a few empty lines enclosed in "… from where are they coming?

Anyway… try to create a new webapp… and check that there is all OK… than applay your changes one by one until you find what is the problem…

I don’t know where that blank lines came from.

I do have a second webapp,and this one runs without that problem… I’m now working on comparing files.

Here comes the other really big problem: when i finished creating my third webapp, it runs to ERROR 500(‘Internal server error’ with my other apps running well)! :blink:

I found the reason why the new app can’t run, all single quotation marks (’) were escaped to \’ in the new app files!

Why? My Yii kernel is latest released version…

don’t know if that’s the case, but recently I had very similar problem, and it was in Chrome / Chromium only, Firefox dealt fine with that.

Removing UTF8 BOM from both my layout and controller files helped…

Yeah! Great! That works! Thank you guy very much! ;D

And… Hey, mdomba, is this a bug? I think you team had better find the reason and write it into the document or get it fixed in the kernel so that no more people get headache on this. Hope to see Yii goes better! :D