Layout.php没有显示header.php部分
问题描述:
我有下面的HTML。
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body style="background:#F7F7F7;">
<div class="">
</div>
</body>
</html>
我把这个html分成两个PHP文件。所以。 Header.php
。
I divided this html in two PHP files. So.There is Header.php
. Like Below.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
Layout.php
<!DOCTYPE html>
<html lang="en">
<? include 'header.php';?>
<body style="background:#F7F7F7;">
<div class="">
</div>
</body>
</html>
问题
Layout.php显示header.php部分。
Problem
Layout.php is not showing the header.php part.
答
我认为问题是短标签,
<?php include 'header.php';?>
但我会说,在codeigniter使用中,
But i would say, in codeigniter use,
$this->load->view("header.php");