Codeigniter:分页链接显示不正确

时间:2021-06-09 21:40:35

标签: codeigniter bootstrap-4 pagination

我在 Codeigniter 中有一个小应用程序。我使用引导程序分页库进行分页。 一切正常,但分页链接显示我们只有 3 页,但有 3 页以上,而且当我单击链接时,总是突出显示第一页,如果我单击箭头,分页效果很好,但是链接显示我在第一页。我还尝试了标准的 codeigniter 分页,结果是一样的。问题是什么? 我的控制器代码:

<块引用>

函数 __construct() { parent::__construct(); $this->load->library('csvimport'); }

public function index()
{


    $this->load->library("pagination_bootstrap");
    $get = $this->db->get('caidb');
    $this->pagination_bootstrap->offset(10);


    $result = $this->pagination_bootstrap->config("/Tires_Crud/index", $get);

//配置分页

     $data=array(); $data['result']=$result; $data['view']=$this->load->view('Tires_Crud', $data, true);

$this->load->view('layouts/master',$data);

我的观点:

<块引用>
<table class="table table-striped table-bordered">
>     <thead>
>     <tr>
>     
>     <td>first</td>
>     <td>sec</td>
>     <td>th</td>
>     <td>th</td>
>     </tr>
>     </thead>
>     <tbody>
>     <?php 
>     if(isset($result))
>     {
>     foreach($result as $value)
>     {
>         echo "<tr><td>". $value->cai . "</td><td>". $value->name ."</td><td>". $value->spot ."</td><td><button type='button'
> id='".$value->cai."' class='btn btn-danger
> delete'>Delete</button></td></tr>";
>      
>     }
>     }
>     ?>
>     </tbody>
>     </table>
>     <?php echo $this->pagination_bootstrap->render(); ?>

pagination

0 个答案:

没有答案
相关问题