Welcome Guest, Not a member yet? Register   Sign In
supporting both query string and segment based URL
#1

[eluser]mironcaius[/eluser]
Hello,
Is their a possibility to support both query strings and segment based url. I can create custom controllers for most of the cases. But maybe I want to have query strings as well for search.
For eg:
example.com/?val1=1&val2=2

How can i do this? For some reason this request fails at :_validate_request in Router class and i get a 404 error.
I am using:
Code:
$config['enable_query_strings'] = FALSE;
$config['uri_protocol']    = "AUTO";
#2

[eluser]mironcaius[/eluser]
I found the solution, change the input class and just add this
Code:
$_GET = $this->_clean_input_data($_GET);
instead of
// Is $_GET data allowed? If not we'll set the $_GET to an empty array
        /*if ($this->allow_get_array == FALSE)
        {
            $_GET = array();
        }
        else
        {
            $_GET = $this->_clean_input_data($_GET);
        }*/

then you extract the data using:
Code:
$this->input->get('var1')




Theme © iAndrew 2016 - Forum software by © MyBB