因此,我正在重新设计一些工作中的工具,以提供有凝聚力的用户体验,并且我有 2 个文件将包含在所有其余文件中。它们是页眉和页脚。它们独立工作,但是当我尝试将它们包含在同一个文件中时,页脚不会显示(我什至尝试将它们放在一个包含文件中)。
这是标题:
<?php
function pageHeader($title){
$html = "<!DOCTYPE html>
<html>
<head>
<link href='../../bootstrap/css/bootstrap.css' rel='stylesheet'>
<title>$title</title>
</head>
<body>
<div class='navbar navbar-fixed-top'>
<div class='navbar-inner'>
<div class='container-fluid'>
<a class='brand' href='/platform'>Platform Tools</a>
<div class='btn-group pull-right'>
<a class='btn dropdown-toggle' data-toggle='dropdown' href='#'>
<i class='icon-user'></i>
Username
<span class='caret'/>
</a>
<ul class='dropdown-menu'>
<li>
<a href='#'>Profile</a>
</li>
<li class='divider'/>
<li>
<a href='#'>Sign Out</a>
</li>
</ul>
</div>
<div class='nav-collapse'>
<ul class='nav'>
<li class='active'>
<a href='#'>
<i class='icon-home icon-white'></i>
APEX Home
</a>
</li>
<li>
<a href='/platform/cms'>
<i class='icon-home icon-white'></i>
CMS Home
</a>
</li>
<li>
<a href='/platform/outbound'>
<i class='icon-home icon-white'></i>
Outbound Home
</a>
</li>
<li>
<a href='/platform/urs'>
<i class='icon-home icon-white'></i>
URS Home
</a>
</li>
<li>
<a href='#bug'>
<i class='con-fire icon-white'></i>
Report a problem
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<script src='/bootstrap/js/jquery.js'/>
<script src='/bootstrap/js/bootstrap-transition.js'/>
<script src='/bootstrap/js/bootstrap-alert.js'/>
<script src='/bootstrap/js/bootstrap-modal.js'/>
<script src='/bootstrap/js/bootstrap-dropdown.js'/>
<script src='/bootstrap/js/bootstrap-scrollspy.js'/>
<script src='/bootstrap/js/bootstrap-tab.js'/>
<script src='/bootstrap/js/bootstrap-tooltip.js'/>
<script src='/bootstrap/js/bootstrap-popover.js'/>
<script src='/bootstrap/js/bootstrap-button.js'/>
<script src='/bootstrap/js/bootstrap-collapse.js'/>
<script src='/bootstrap/js/bootstrap-carousel.js'/>
<script src='/bootstrap/js/bootstrap-typeahead.js'/> ";
return $html;
}
?>
这是页脚:
<?php
function pageFooter(){
$html ="
<nav class='footer'>
<a href='#'>Apex</a>
<a href='#'>Contest</a>
<a href='#'>Outbound</a>
<a href='#'>URS</a>
<a href='#'>Third Party Tools</a>
<a href='#'>Report a Problem</a>
<a href='#'>Our SLA</a>
<a href='#'>Contact</a>
</nav>
</body>
</html> ";
return $html;
}
?>
当我将它们包含在我的 FrontDoor.php 文件中时,它看起来像这样(将更改为相对路径):
<?php include('C:\xampp\htdocs\webapps\Redesign\Oreo\src\Header.php'); ?>
<?php include('C:\xampp\htdocs\webapps\Redesign\Oreo\src\Footer.php'); ?>
<?php echo pageHeader('Platform Tools'); ?>
<?php echo pageFooter(); ?>
当我尝试运行它时,它会运行页眉,然后关闭正文和 html 标签,并且不运行页脚。
有什么建议和感谢吗?