Welcome Guest, Not a member yet? Register   Sign In
Query Strings after controller/method
#1

[eluser]Unknown[/eluser]
I have a Code Igniter 1.6.3 site with a custom route such that when I visit http://www.example.com/Something/Else it redirects to a controller method with 2 variables. I would like to be able to pass in a query string along with the string that I could use in the controller, for instance http://www.example.com/Something/Else?edit=true.

Is this possible? If so, how do I go about doing this? Thanks in advance!
#2

[eluser]Colin Williams[/eluser]
It might be better to just tack on URI parameters, like

Code:
http://www.example.com/something/else/edit

Then, you check that third param with $this->uri->segment(3)
#3

[eluser]James Gifford[/eluser]
Just make a controller like this:

Code:
function Something extends Controller
{
    // Constructor goes here

    function else ($edit = false)
    {
        // Whatever code you need
    }
}

Then with the following url:

Code:
http://www.example.com/something/else/1

the $edit variable will have a value of 1 (true).




Theme © iAndrew 2016 - Forum software by © MyBB