この種のフォーマットは、Codeigniter では必要ありません。クエリ文字列を有効にすることはできますが、私の意見では、クエリ文字列を使用することは、物事を処理するコードイグナイターの方法に反します。uri を介してビューから変数を渡すことができるためです。
http://yourdomain_baseurl/controller/controller_function/var1/var2/var3
次のことをお勧めします。
次のような URL で変数を送信します。
http://yourdomain_baseurl/admin/post_action/id/action
「管理者」コントローラーで、次のようなものを作成できます。
function post_action($id, $action){
switch ($action) {
case "delete":
//do something here with your post with id $id
break;
case "update":
//do something here with your post with id $id
break;
case "create":
//do something here with your post with id $id
break;
}
}
または、Post アクションごとに別の関数を作成したい場合:
http://yourdomain_baseurl/admin/post_delete/id
http://yourdomain_baseurl/admin/post_edit/id
管理コントローラーで次の関数を使用する
function post_delete($id){
//Delete Archive the post with $id here!
}
function post_edit($id){
//edit the post with $id here!
}
ほとんどのユーザー入力はフォームから行われるため、$_POST データを使用してユーザー入力を取得できます。あなたを助ける便利なクラスがあります:
$this->input->post('some_data');
codeigniter に付属のドキュメントを読んで、以下を読むことをお勧めします。
URL の
http://ellislab.com/codeigniter/user-guide/general/urls.html
URL
http://ellislab.com/codeigniter/user-guide/general/routing.html