Welcome Guest, Not a member yet? Register   Sign In
How to pass variables in URL in CodeIgniter?
#1

[eluser]Sinclair[/eluser]
Hi,

I need to pass variables in the URL, just like this:

http://www.mysite.com/rss.php?height=tal...air=blonde

It is possible to do this?


Best Regards,
#2

[eluser]Sbioko[/eluser]
Why not? Just turn on GET strings in config.php and modify your controller, method triggers.
#3

[eluser]Sinclair[/eluser]
Thanks for the reply,

Where can I get examples?

Best Regards,
#4

[eluser]Sbioko[/eluser]
http://ellislab.com/codeigniter/user-gui.../urls.html

You are welcome.
#5

[eluser]Sinclair[/eluser]
Once again, thanks for the reply.~

If I do this, my application will force me to use query strings?

Code:
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';

I need to use URLs in the two ways:

index.php?c=controller&m=method
and
index.php/controller/method

At this time I have only one controller that need to use query strings.

Is this possible?

Best Regards,
#6

[eluser]Sbioko[/eluser]
With hacking yes :-) Without - no :-) My favourite thing is hacking the CI core :-)
#7

[eluser]Sinclair[/eluser]
Do you have done it?

Best Regards,
#8

[eluser]Sinclair[/eluser]
I have searched and I found that is possible to use the $this->uri->uri_to_assoc(n) to do what I want...

Best Regards,




Theme © iAndrew 2016 - Forum software by © MyBB