2014-11-04 104 views
1

我使用下面的配置分頁如何L1標籤添加到每個錨標記在分頁的笨

$config['base_url'] = base_url() . 'index.php/admin/list_employees'; 
    $config['total_rows'] = $this->database->get_num_records('user'); 
    $config['per_page'] = 10; 
    $config['uri_segment'] = 3; 
    $config['num_links'] = 9;  

    $config['full_tag_open'] = '<div class="text-center"><ul class="pagination">'; 
    $config['full_tag_close'] = '</ul></div><!--pagination-->'; 

它呈現爲

div class="text-center"><ul="pagination">&nbsp;<strong>1</strong>&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/10">2</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/20">3</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/30">4</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/40">5</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/50">6</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/60">7</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/70">8</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/80">9</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/90">10</a> 
&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/10">&gt;</a> 
&nbsp;&nbsp;<a href="http://localhost/PhpProject2/index.php/admin/list_employees/110">Last &rsaquo;</a> 
</ul></div><!--pagination--> 

我如何添加<li>到每個錨標記

回答

2

添加您的以下配置:

$config['num_tag_open'] = '<li>'; 
$config['num_tag_close'] = '</li>'; 
0

爲了將所有分頁內的鏈接都包裹起來,您需要指定很多配置。如下:

$cfg['full_tag_open']= '<div class="cols-xs-12 text-center"><ul class="pagination">'; 
$cfg['full_tag_close']= '</ul></div>'; 
// first link 
$cfg['first_tag_open']= '<li class="first">'; 
$cfg['first_tag_close']= '</li>'; 
// last link 
$cfg['last_tag_open']= '<li class="last">'; 
$cfg['last_tag_close']= '</li>'; 
// current active pagination 
$cfg['cur_tag_open'] = '<li class="active"><a href="#">'; 
$cfg['cur_tag_close'] = '</a></li>'; 
// number link 
$cfg['num_tag_open'] = '<li>'; 
$cfg['num_tag_close'] = '</li>'; 
// next (>) link 
$cfg['next_tag_open'] = '<li>'; 
$cfg['next_tag_close'] = '</li>'; 
// prev (<) link 
$cfg['prev_tag_open'] = '<li>'; 
$cfg['prev_tag_close'] = '</li>'; 
相關問題