1
因此,我正在重新設計一些工具來創造一個有凝聚力的用戶體驗,我有2個文件,我將包括在其餘所有。他們是一個頭和一個頁腳。他們獨立工作,但當我試圖將它們包含在同一個文件中時,頁腳不顯示(我甚至試圖將它們放在一個包含文件中)。html和body標籤關閉之前,我告訴他們到PHP
這裏的標題:
<?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(); ?>
當我嘗試運行它時,它運行標題,然後關閉body和html標記,並且不運行頁腳。
任何建議和感謝?
這是不可能的。你能粘貼生成的HTML嗎? – Florent 2012-07-24 15:06:02
你是說當你把它們都包括在內時,它仍然輸出結束'