How to achieve
/index.php/myapp?id=1
in codeigniter format
like
/index.php/myapp/id/1
But the above doesn’t work
Thanks!
UPDATE per comment:
URL=/index.php/myapp/show/1
function show(){
$data=$this->input->get();
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CodeIgniter uses controllers and URL segments to achieve this. With URI Class you will be able to access the ID with
$this->uri->segment(3).You can remove
/id/from your address and make a kind of RESTful scheme that will redirect/:any/:numto/:any/show/:num. This way, you’ll just have to create ashowmethod in your controller to get the ID and process it.