CodeIgniter Forums
query strings question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: query strings question (/thread-50708.html)



query strings question - El Forum - 04-05-2012

[eluser]Unknown[/eluser]
The current project I'm working on does not require any search-engine friendliness, so I'm much rather to use query strings instead of CI's segments. It's probably more of a habbit thing really.

As an example of Codeigniter's query string usage, I dug into the code of my fresh installation of Expression Egine, since it's written on CI and uses query strings in its backend app. What bothers me the most is:

First.
config.php in EE's config folder contains lines:
Code:
$config['enable_query_strings'] = FALSE;
$config['directory_trigger'] = 'D';
$config['controller_trigger'] = 'C';
$config['function_trigger'] = 'M';
yet still uses query strings instead of segments. How does this work? I have no idea. Could anyone elaborate on how query strings are still being accepted even though the EE's codeigniter is configured to not accept those?

Second.
After clicking through the interface of EE's app I discovered that my URL looks like this
Code:
http://ee/system/index.php/index.php/index.php/index.php?S=b14ceb15f0d585360299d9b7d85beed0b0fae7ee&D=cp&C=tools
and it really bothers me, since I don't want to have this many index.php in my URLs in the app im currently working on. And if things like that happen in CodeIgniter's authors project, is this considered to be normal having 3 index.php files in your url?


query strings question - El Forum - 04-07-2012

[eluser]Naveed Hasan[/eluser]
CASE 1:
Code:
$config['allow_get_array'] = TRUE;

The above allows Get Params in General


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

In the above, say, 'enable_query_strings' is set to "TRUE", then the URL
http://localhost/yoursite/index.php?c=welcome&m=show_content
will cause a controller named "welcome" to be invoked. And, inside it, the function "show_content" will also be called. In CASE 1, the controller "welcome" will not be invoked even if the same URL is used.