Please consider querystring support in 2.x - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Please consider querystring support in 2.x (/showthread.php?tid=31698) |
Please consider querystring support in 2.x - El Forum - 07-24-2010 [eluser]chefnelone[/eluser] Wan, before going with your fix i have a question: My site is using segments. Will this fix allow the segments work properly? I mean I need GET and segments working together. Please consider querystring support in 2.x - El Forum - 07-24-2010 [eluser]WanWizard[/eluser] Yes. If you set 'enable_query_strings' to FALSE, and 'allow_get_array' to TRUE, your application will route using URI segments, and populate the $_GET array with the parameters of the query string. Please consider querystring support in 2.x - El Forum - 07-26-2010 [eluser]chefnelone[/eluser] Wan, I'm affraid I'll need some help with this. (remember I need to have GET and Segments working together) I did: 1- In ci/application/config.php I add: Code: $config['allow_get_array'] = 'FALSE'; // + ADDED 2- In ci/system/codeigniter/Codeigniter.php I changed this: Code: $CFG =& load_class('Config'); Code: $CFG =& load_class('Config'); 3- In ci/system/library/Input.php I changed this (but don't know how to assign the config value to the new variable): Code: class CI_Input { Code: class CI_Input { 4- In ci/system/library/Input.php. Could you tell me the lines to add/change in the Input library constructor? Code: function CI_Input() 5- In ci/system/library/URI.php. Do I nedd to add/change something? thanks Please consider querystring support in 2.x - El Forum - 07-26-2010 [eluser]WanWizard[/eluser] Just look at the patch file: In URI.php, find: Code: if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') Code: if ($this->config->item('enable_query_strings') === TRUE && is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') In Input.php, add: Code: var $enable_query_strings = FALSE; Code: $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; Code: $this->allow_get_array = ($CFG->item('allow_get_array') === TRUE) ? TRUE : FALSE; In CodeIgniter.php, find: Code: $CFG =& load_class('Config'); Code: $CFG =& load_class('Config'); find: Code: $LANG =& load_class('Language'); Code: $IN =& load_class('Input'); Note: if you're using CI 2.0, you could download the modified files from our repository: http://www.exitecms.org/trac8/browser/trunk/system/core Please consider querystring support in 2.x - El Forum - 07-26-2010 [eluser]chefnelone[/eluser] thanks wan! Please consider querystring support in 2.x - El Forum - 07-28-2010 [eluser]skunkbad[/eluser] [quote author="WanWizard" date="1280154812"]Just look at the patch file: In URI.php, find: Code: if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') Code: if ($this->config->item('enable_query_strings') === TRUE && is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') In Input.php, add: Code: var $enable_query_strings = FALSE; Code: $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; Code: $this->allow_get_array = ($CFG->item('allow_get_array') === TRUE) ? TRUE : FALSE; In CodeIgniter.php, find: Code: $CFG =& load_class('Config'); Code: $CFG =& load_class('Config'); find: Code: $LANG =& load_class('Language'); Code: $IN =& load_class('Input'); Note: if you're using CI 2.0, you could download the modified files from our repository: http://www.exitecms.org/trac8/browser/trunk/system/core[/quote] It's a shame that this hasn't made it into 2.0. Please consider querystring support in 2.x - El Forum - 07-28-2010 [eluser]pbreit[/eluser] Yes, it would be terrific if CI had reasonable querystring support "out-of-the-box". This is a very standard internet technology that should be readily available to all web developers. Please consider querystring support in 2.x - El Forum - 07-28-2010 [eluser]WanWizard[/eluser] 2.0 isn't released yet, so who knows... Please consider querystring support in 2.x - El Forum - 07-28-2010 [eluser]kkristo[/eluser] ... and if people don't use english language ? Try use search term from russian, estonian, finish or some other language. www.example.com/search/нам нужно больше www.example.com/search/öömaja www.example.com/search/möki I hope this different language problem are out from CO 2.0 (restricted char) Please consider querystring support in 2.x - El Forum - 07-28-2010 [eluser]WanWizard[/eluser] 'permitted_uri_chars' is a config option, described in the manual. If the default doesn't suit you, change it. That's what it's there for. |