Reputation: 213
i already make two changes in config file to enable the $_GET
array as
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = true;
but whenever i try tow run my code as http://example.com/controller/function/$demo=demo
it redirected towards the default controller
Upvotes: 1
Views: 6745
Reputation: 3534
Enabling query strings in CodeIgniter means that you're using the query string to pass in the controller and function instead of them being parsed from the PATH INFO.
If you want to use the default system for determining what controller and function to use, you do not want to set $config['enable_query_strings']
to true
.
This previous SO post covers how to enable teh $_GET array in CodeIgniter: Enabling $_GET in codeigniter
I think that's what you're trying to do.
Upvotes: 2
Reputation: 382616
You also have to set controller and function triggers from config:
$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
So once query string is enabled, you can access it like this:
http://example.com/index.php?c=controller&m=function&demo=demo
Upvotes: 1