私はjQueryを使用します
$('#myform').submit(function(){
$(this).attr('action', $(this).attr('action') + "/" + $(this).find(input[name="keyword"]).val());
});
もう 1 つの可能性は、コントローラーでプロキシ メソッドを作成することです。URL にすべての投稿値を含めたい場合に便利です。
public function post_proxy() {
$seg1 = $this->input->post('keyword');
$seg2 = $this->input->post('keyword2');
$seg3 = $this->input->post('keyword3');
redirect('my_method/'.$seg1.'/'.$seg2.'/'.seg3);
}
その場合、ポスト データで配列を使用してコードを簡素化します。
<input type="text" name="kw[1]">
<input type="text" name="kw[2]">
<input type="text" name="kw[3]">
$segment_array = $this->input->post('kw');
$segments = implode("/", $segment_array);
redirect('my_method'.$segments);