我面临一个非常奇怪的问题。请帮帮我。
我正在使用CodeIgniter框架。当我在浏览器中运行php代码时,它不会显示任何内容,而是当我回显控制器中的任何其他东西时,它会被回显。
当我在Mozilla浏览器中右键单击源代码时看到源代码,但当我使用firebug查看代码时,所有代码都在那里,除了body标签是空白的。
FireBug代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>temp</title>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link type="text/css" rel="stylesheet" href="http://127.0.0.1/dawn/assets/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="http://127.0.0.1/dawn/assets/css/custom.css">
<script src="bootstrap-3.3.6/js/bootstrap.min.js">
</head>
<body>
</body>
</html>
控制器:home.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends MY_Controller
{
public function index()
{
$this->load->view('home');
}
}
?>
查看:home.php
<?php
echo require_once('header.php');
?>
<div class="container-fluid text-center col-sm-6 bg-1">
<?php echo anchr('student/index', '<h1>Student</h1>'); ?>
<?php
$image_properties = array(
'src' => 'assets/img/sun.jpg',
'alt' => 'Logo',
'class' => 'img-circle',
'width' => '150',
'height'=> '150',
'title' => ' ',
'rel' => ''
);
echo img($image_properties);
?>
<h3>Fulfill Your Dreams of Education in Abroad.</h3>
</div>
<div class="container-fluid text-center col-sm-6 bg-1">
<a href="#">
<h1>Institution</h1>
<?php
$image_properties = array(
'src' => 'assets/img/sun.jpg',
'alt' => 'Logo',
'class' => 'img-circle',
'width' => '150',
'height'=> '150',
'title' => ' ',
'rel' => ''
);
echo img($image_properties);
?>
<h3>Fulfill Your Dreams of Education in Abroad.</h3>
</a>
</div>
<div class="container-fluid text-center col-sm-6 bg-1">
<a href="#">
<h1>Fun Buddies</h1>
<?php
$image_properties = array(
'src' => 'assets/img/sun.jpg',
'alt' => 'Logo',
'class' => 'img-circle',
'width' => '150',
'height'=> '150',
'title' => ' ',
'rel' => ''
);
echo img($image_properties);
?>
<h3>Fulfill Your Dreams of Education in Abroad.</h3>
</a>
</div>
<div class="container-fluid text-center col-sm-6 bg-1">
<a href="#">
<h1>Counselling</h1>
<?php
$image_properties = array(
'src' => 'assets/img/sun.jpg',
'alt' => 'Logo',
'class' => 'img-circle',
'width' => '150',
'height'=> '150',
'title' => ' ',
'rel' => ''
);
echo img($image_properties);
?>
<h3>Fulfill Your Dreams of Education in Abroad.</h3>
</a>
</div>
<?php echo include('footer.php'); ?>