1

routes.php でルートを次のように構成しました。

$route['job-history/(:num)'] = "customer/customer/jobhistory/$1";

次のようにコントローラーでページネーション構成、

$this->load->library('pagination');
$config['per_page'] = 25;
$config['total_rows'] = 100;
$config['base_url'] = $this->config->item('base_url').'job-history';
$config["uri_segment"] = 2;
$this->pagination->initialize($config);
$page = ($this->uri->segment(2)) ? $this->uri->segment(3) : 0;

ロード中に404エラーページが表示され、

www.example.com/job-history

www.example.com/job-history/0 のようにゼロを手動で追加すると機能します。

www.example.com/job-history を最初のページとして読み込むにはどうすればよいですか。私の構成で何が問題なのですか。助けてください

4

2 に答える 2

12

単一job-historyセグメントのルートも必要です。

$route['job-history/(:num)'] = 'customer/customer/jobhistory/$1';
$route['job-history'] = 'customer/customer/jobhistory';
于 2013-04-12T09:32:29.937 に答える
2

route.php では、その後に番号セグメントがあるジョブ履歴ページについてのみ言及しており、ページのジョブ履歴のみにそのようなルールがないため、404 にリダイレクトされます。

追加

$route['job-history'] = 'customer/customer/jobhistory';

$route['job-history/(:num)'] = 'customer/customer/jobhistory/$1';
于 2013-04-12T09:56:07.290 に答える