我是codeigniter的新手,我通过从Category Id获取查询结果来使用codeigniter分页,但页面总是从第2页开始。如何修复分页以将起始页设置为第1页?
public function kategori($kat=''){
$config['base_url'] = base_url().'index.php/lowongan/kategori/'.$kat;
$data['db']=$this->query->katPostingan($kat);
$config['tota
我正在处理分页,我想将我的分页url从这个:http://localhost/Pedestana/index.php/Pengunjung/index/#desa/ (这是分页偏移)修改为这个:http://localhost/Pedestana/index.php/Pengunjung/index/ (这是分页偏移)/#desa。当页面加载时,它将向下滚动到id #desa 我试过更改config['uri_segment'],但它不能正常工作。 public function index(){
$this->load->database();
这是我的代码和我在注释行中的问题。
public function sonuc()
{
$config['total_rows'] = 5 //i want to set here count of result instead of digit. count($data['sonuc']) does not work.. what will i do?
$config['per_page'] = 2;
$data['sonuc'] = $this->emlak_model->arama(
我正在使用codeigniter分页。但是我在使用codeingiter分页时遇到了一个问题。这就是我面临的问题。
例如:如果一个页面有超过10条记录,而我在这里每页显示5条记录。如果我点击第二页,它会正确显示数据,但如果我需要返回第一页,它就不起作用了。下面是我的代码:
控制器:
class Testimonial extends CI_Controller {
function __construct() {
parent::__construct();
//here we will autoload the pagination library