您好我正在使用codeigniter框架,并且我已经实现了后端功能部件来上传投资组合部分的图像它工作正常。但是在前端显示这些图像时它以水平方式显示但图像应该以垂直顺序显示。这里是我的代码。
控制器:
function index()
{
$this->load->model('portfolio_model');
$data['records2'] = $this->portfolio_model->get_portfolio();
$data['mainpage'] = "portfolio";
$this->load->view('templates/template',$data);
}
型号:
function get_portfolio()
{
$this->db->Select('portfolio.*');
$this->db->From('portfolio');
$this->db->where(array('portfolio.status'=>1));
$q=$this->db->get();
if($q->num_rows()>0)
{
return $q->result();
}
else
{
return false;
}
}
查看:
<?php if(isset($records2) && is_array($records2)):?>
<?php foreach ($records2 as $r):?>
<div class="portfolioimages">
<img src="<?php echo base_url();?>admin/images/portfolioimages/<?php echo $r->image_path;?>" alt="portfolioimages" class="portfoliomage1"/>
</div>
<?php endforeach; endif;?>