私が今持っているのは、4 行にスタイル設定された 100 の div のようなもので、ページネーションを追加したいのですが、このコードで成功しました:
public function func() {
$this->load->library('pagination');
$this->load->database('default');
$this->load->model('s_model');
$data['all_rows_s'] = $this->s_model->count_all_s();
$data['$total_s'] = $config['total_s'] = $this->s_model->count_all_ss();
$config['base_url'] = 'http://example.com/display/s/';
$config['total_rows'] = $data['all_rows_s'];
$config['per_page'] = 12;
$config['num_links'] = 5;
$config['full_tag_open'] = '<div class="page_row">';
$config['full_tag_close'] = '</div>';
$data['row'] = $this->db->get('s_data',$config['per_page'], $this->uri->segment(3))->result();
$this->pagination->initialize($config);
$this->template->set_theme(Settings_model::$db_config['active_theme']);
$this->template->set_layout('main');
$this->template->title($this->lang->line('s'));
$this->process_partial('header', '/header');
$this->process_partial('footer', '/footer');
$this->process_template_build('s_view', $data);
}
しかし、これは次の行のためにテーブルなしで機能しているためです。
$data['row'] = $this->db->get('s_data',$config['per_page'], $this->uri->segment(3))->result();
order by id
しかし、 や のように、さらにフィルターを作成する必要がありwhere date > NOW()
ます。これを行うにはどうすればよいですか? この get を置き換えてコードを引き続き機能させるにはどうすればよいですか。また、ビューはテーブルなしでdivs
、foreach
.
ありがとう!