• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter urls


I would just like some clarification on the CodeIgniter url module. If I developed a simple search form in standard php using the GET method, I would get a standard query string such as
. If I did the same in CodeIgniter, would it automatically rewrite the url to something like

Yes. If you used that url, you would have method named search in the Welcome controller with a parameter $id for example. Heres a cup of RTFM Wink

To answer the second part of your question, no codeigniter will not automatically rewrite your URLS. If you submit a form using GET you are going to get your first URL (?id=2). You need to craft your URLS properly, using POST for form submits, etc... That said, as cahva pointed out, using your second URL codeigniter would properly route you to the Welcome controller and the Search method passing it a variable that in your case, equals 2.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.