OOPとPHPのパターンを学び始めましたが、MVCの使用で問題が発生しました。私は次のファイルを持っています:
index.php
<?php
include_once("controller/controller.php");
$controller = new Controller();
$controller->view->display();
?>
controller.php
<?php
class Controller
{
public $view;
public function __construct()
{
include_once("view/view.php");
$this->view = new View();
}
}
?>
view.php
<?php
class View
{
public $layout = "layout/layout.html";
public function display()
{
include $this->layout;
}
}
?>
layout.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Dokument bez tytułu</title>
<style>
body {
background-color:#0066CC;
margin:0;
padding:0;
}
#page {
background-color:#000;
width:960px;
height:650px;
margin:0 auto;
}
</style>
</head>
<body>
<div id="page"></div>
</body>
</html>
ブラウザがこのウェブサイトをクァークズモードで表示する理由を誰かが説明できますか?これで最悪なのは、画面上部の余白です。これは本当に迷惑です。この問題と解決策についての情報をいただければ幸いです。