我正在尝试从文件夹中显示我的房屋图像,但它显示了这样的错误
404(未找到)
我的代码如下
<?php
$PropertyType = "";
$image = "";
if($data != null)
{
foreach($data as $key=>$value)
{
$PropertyType = $value['PropertyType'];
$image=$value['HouseImage1'];
}
}
?>
前端代码是这样的
<img src="<?php echo base_url('assets/images/House/'. $image);?>" alt="tab1" class="img img-responsive">
文件夹层次结构如下所述
这是模型函数
public function SIngleHouseADD($houseID)
{
$this->db->select('*');
$this->db->from('housedetail');
$this->db->where('HouseID', $houseID);
//$qry = $qry->result_array();
$query=$this->db->get();
$resultArray = $query->result_array();
return $resultArray;
//return $qry;
}
这个是控制器
public function SingleProperty()
{
//$HouseID = $_GET['id'];
$this->load->model('SingleAddModel');
$plots = $this->SingleAddModel->SIngleHouseADD($_GET['id']);
$data = array();
$data["data"] = $plots;
$this->load->view('SinglePropertyDetail_view', $data);
}