私は CakePhp 2.0 に奇妙なエラーがあり、head タグが空でレンダリングされ、head に属するすべてのタグがコンテンツの前に body にレンダリングされます。
これは、レイアウトの default.ctp がどのように見えるかを示しています。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $this->Html->charset(); ?>
<title>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $this->Html->meta('icon');
echo $this->Html->script(array('librerias/jquery.tools.min'));
echo $this->Html->css('cake.generic');
echo $this->Html->css('webfront');
echo $scripts_for_layout;
?>
</head>
<body>
<div id="container">
<div id="header">
</div>
(the rest of the html render)
</body>
</html>
firebug が言うように、これはそれがどのようにレンダリングされるかです:
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title> Usuarios </title> **(IE moves the title tag on the head manually, it seems)**
**(IE displays the DOCTYPE on its debugging console here)**
<link rel="icon" type="image/x-icon" href="/web/favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="/web/favicon.ico">
<script src="/web/js/librerias/jquery.tools.min.js" type="text/javascript">
<link href="/web/css/cake.generic.css" type="text/css" rel="stylesheet">
<link href="/web/css/webfront.css" type="text/css" rel="stylesheet">
<div id="container">
<div id="header"> </div>
(the rest of the html render)
</body>
</html>
DOCTYPE タグを歪め、IE がページを非常にバグのあるものにレンダリングするため、これは十分に悪いことです。
また、このエラーが発生しない別のテスト サイトがあります。実際、レイアウトを切り替えましたが、エラーは同じでした。
誰かがなぜこれが起こるのか知っていますか? ウェブ上で同様のものを見つけることができず、これについての手がかりもありません。どんな助けでも大歓迎です。
前もって感謝します