Codeigniter 分页create_link()
在视图页面上显示空白..
当我从控制器功能回显分页create_link
时,它显示完美,但是当我尝试在视图页面上回显它时,它显示为空白。
谢谢。
//下面是我的代码控制器代码
$row=$this->city_model->city_list();
//pagination start here
$config['base_url'] = 'http://localhost/edu/index.php/admin/city/index';
$config['total_rows'] = count($row);
$config['per_page'] = 10;
$config['num_links']=20;
$this->pagination->initialize($config);
$row=$this->city_model->city_listing($config['per_page'],$this->uri->segment(4));
//pagination end here
//This will generate data into table format
//$row=$this->city_model->city_list();
$tmpl = array ( 'table_open' => '<table class="data display datatable">' );
$this->table->set_heading('City Name','State', 'Edit', 'Delete');
$this->table->set_template($tmpl);
foreach($row as $r)
{
$edit = anchor('javascript:void(0)','Edit','id="overlay_dialog"');
$del = anchor('/admin/city/deleteCity/'.$r->city_id ,'Delete');
$this->table->add_row($r->city_name,$r->stateName,$edit,$del);
}
$data['city_table']=$this->table->generate();
echo $this->pagination->create_links();//pagnigation links work here
$this->load->view('admin/header');
$this->load->view('admin/leftmenu');
$this->load->view('admin/city',$data);
$this->load->view('admin/footer');
//这是我的视图代码
echo $city_table;
echo $this->pagination->create_links();