help with $_GET in CI |
[eluser]look66[/eluser]
Hi I do not speak English, I am Brazilian, I speak English very bad. My doubt is: I was wondering if you can send the value of a variable after the first bar, example: www.example.com.br/var1 www.example.com.br/var2 I wanted to send this variable for main page of the site, but the URL stay with this format base url () + var Anyone have any tips? Thank you!
[eluser]Rowan Wilson[/eluser]
check out the URI class: http://ellislab.com/codeigniter/user-gui...s/uri.html I think that's what you are referring to.
[eluser]look66[/eluser]
[quote author="rowstu" date="1356093092"]check out the URI class: http://ellislab.com/codeigniter/user-gui...s/uri.html I think that's what you are referring to.[/quote] Thanks for the reply Currently I am passing the variable as follows: http://www.example.com/Home/index/var1 I want the url to this view http://www.example.com/var1 sending the 'var1' to the 'index' method of the controller 'Home'
[eluser]InsiteFX[/eluser]
index method: Code: // -------------------------------------------------------------------- Add this to your Controller: Code: // -------------------------------------------------------------------- routes.php Code: // ------------------------------------------------------------------------
[eluser]look66[/eluser]
@ InsiteFX thank you for your reply! Your reply was exactly what I needed! I only have one more doubt: what function this 'if' you posted [code] if (method_exists ($ this, $ method)) { return call_user_func_array (array ($ this, $ method), $ params); } show_404 (); [/ code]
|
Welcome Guest, Not a member yet? Register Sign In |