激活页面总是以粗体显示,并且不知何故不合适。不知道我哪里错了。我只是试图将页面链接显示为单个链接,计划稍后添加 CSS,但似乎无法找出如何摆脱活动页面链接。另外,我正在使用 Twitter Bootstrap 3。
控制器:
private function paginate_create_table($search = null)
{
// Set pagination configuration
$config = array();
$config['base_url'] = base_url()."index.php/Home/on_hold_lot";
$config['suffix'] = '?cust_drop_down='.$search['customer'].'&area_drop_down='.$search['stage'].'&status_drop_down='.$search['lot_status'].'&search_lot='.$search['search_lot'];
$config['first_url'] = $config['base_url'].$config['suffix'];
$config['total_rows'] = $this->home_model->fetch_lots('rows', $search);
$config['per_page'] = 10;
$config['uri_segment'] = 3;
$config['next_link'] = 'Next';
$config['prev_link'] = 'Previous';
$this->pagination->initialize($config);
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$results = $this->home_model->fetch_lots('array', $search, $config['per_page'], $page);
return $results;
}
public function load_lot_table()
{
// Get form values
if($this->input->get())
{
$search = array(
'customer' => $this->input->get('cust_drop_down'),
'stage' => $this->input->get('area_drop_down'),
'lot_status' => $this->input->get('status_drop_down'),
'search_lot' => $this->input->get('search_lot')
);
}
else
{
$search = array(
'customer' => 'all',
'stage' => 'all',
'lot_status' => 'all',
'search_lot' => ''
);
}
// Paginate retrieved lots
$results = $this->paginate_create_table($search);
if($results != FALSE)
{
// Assign retrieved lots to assoc array
$data['disp_rows'] = $results;
// Create page links for Next page, Page 1 etc
$str_links = $this->pagination->create_links();
$data['links'] = explode(" ", $str_links);
}
else
{
$data['error_message'] = "No rows";
}
return $this->load->view('home/lot_disposition', $data);
}
看法:
<div class="container text-right">
<ul class="pagination">
<?php foreach ($links as $link)
{
echo "<li>$link</li>";
}
?>
</ul>
</div>