$route['Written-qb/(:any)/(:any)/(:any)'] は機能しません。
<p>uri セグメント 2 と 3 を使用すると機能しますが、uri セグメント 4 を追加すると機能しません。 </p><p>URL は次のようになります... http://localhost/maruf/writing-qb/bcs/44th-bcs-english/how-has-the-phrase-digital-detox-通路で説明されましたか? </p><p>しかし、それは次のように表示されます... http://localhost/maruf/write-qb/bcs/how-has-the-phrase-digital-detox-been-explained-in-the - 通路?どちらの URL にも 404 が表示されます。 </p><p>これが私のルーティング設定です。</p>
<pre class="brush:php;toolbar:false;">$route['write-qb/(:num)'] = 'write-qb'; //動作します
$route['write-qb/(:any)/(:any)'] = 'write-qb/write_qb_details/$1/$2'; //動作します
$route['Written-qb/(:any)/(:any)/(:any)'] = 'Written-qb/Written_qb_answer/$1/$2/$3'; // 動作しません</pre>
<p>私のコントローラーは...</p>
<pre class="brush:php;toolbar:false;">public functionindex(){
$data['qb_list'] = $this->Question_bank_model->get_qb_with_category(FALSE);
//フッターデータ
$data['main_content'] = 'write_qb';
$this->load->view('include/template',$data);
} // 正常に動作します
public function write_qb_details($category, $slug = NULL){
$config['uri_segment'] = 2;
$slug = $this->uri->segment(3);
//データ
$data['qb_list'] = $this->Question_bank_model->get_qb_with_category(FALSE);
$data['qb_info'] = $this->Question_bank_model->get_qb_details($slug, $config['uri_segment']);
if(empty($data['qb_info'])){
show_404();
}
$data['url_slug'] = $data['qb_info']['qb_exam_slug'];
$data['meta_title'] = $data['qb_info']['qb_exam'];
$data['meta_description'] = $data['qb_info']['qb_exam_post_meta'];
$data['meta_keywords'] = $data['qb_info']['qb_exam_post_tags'];
//ビュー
$data['main_content'] = 'write_qb_details';
$this->load->view('include/template',$data);
} // 正常に動作します
public function writed_qb_answer($slug = NULL, $slug2 = NULL){
$config['uri_segment'] = 2;
$slug = $this->uri->segment(3);
$slug2 = $this->uri->segment(4);
//データ
$data['qb_info'] = $this->Question_bank_model->get_qb_answer_details($slug, $slug2, $config['uri_segment']);
if(empty($data['qb_info'])){
show_404();
}
$data['url_slug'] = $data['qb_info']['qb_exam_question_slug'];
$data['meta_title'] = $data['qb_info']['qb_exam_question'];
$data['meta_description'] = $data['qb_info']['qb_exam_answer_meta'];
$data['meta_keywords'] = $data['qb_info']['qb_exam_answer_tags'];
//ビュー
$data['main_content'] = '答え';
$this->load->view('include/template',$data);
}// それは機能しません</pre>
<p>しかし我のモデルは...</p>
<pre class="brush:php;toolbar:false;">public function get_qb_details($slug = FALSE){
if($slug === FALSE){
$this->db->order_by('qb_post.qb_exam_slug', 'DESC');
$this->db->join('qb_category', 'qb_category.qb_category_name_slug = qb_post.qb_category_name_slug');
$this->db->where('qb_exam_active',1);
$query = $this->db->get('qb_post');
return $query->result_array();
}
$query = $this->db->get_where('qb_post', array('qb_exam_slug' => $slug));
$query->row_array(); を返す
}
パブリック関数 get_qb_answer_details($slug2 = FALSE){
if($slug2 === FALSE){
$this->db->where('qb_exam_answer_active',1);
$query = $this->db->get('qb_exam_ans');
return $query->result_array();
}
$query = $this->db->get_where('qb_exam_ans', array('qb_exam_question_slug' => $slug2));
$query->row_array(); を返す
}</pre>
<p>在制御器"Written_qb_answer"中、および在路由$route['Written-qb/(:any)/(:any)/(:any)'] = 'Written-qb/Written_qb_answer/$1/$2 /$3';中は、404 エラーが表示されます。