我控制器的foreach没有出现在视图
<?php
class Blog extends Controller {
function Blog()
{
parent::Controller();
}
function index()
{
$data['title']= "this is a blog";
$data['heading']="Pretty wise";
$data['query']= $this->db->get('entries');
$this->load->view('blogview.php',$data);
}
}
?>
我的视图文件是
<html>
<head>
<title><?= $title ?></title>
</head>
<body>
<h1> <?=$heading?></h1>
<?php foreach($query->result() as $row): ?>
<h3><?= $row->title ?></h3>
<p><?= $row->body ?></p>
<hr>
<?php endforeach; ?>
</body>
</html>
的这个输出是像这样的东西
title ?>
body ?>
---------------------
title ?>
body ?>
---------------------
漂亮错过了一个页面起来吧?笑
我相信对其他数据库连接的东西, 我试图输出在我的数据库
Firefox中的标题是= $title ?> – faris 2010-12-14 17:42:57