Welcome Guest, Not a member yet? Register   Sign In
How to use a variable in: $this->index(); ?
#5

[eluser]chefnelone[/eluser]
Ok, I see.
I'll remake my question:

Let's say I have 3 functions in a controller. When the index function is called it runs one of the other functions based in the value of $page.

Code:
function index(){
     $page = $this->uri->segment(1); //this can take the values: 'gallery', 'contact', anyOther...

     // if value of $page is 'gallery'
     $this->gallery();

     // if value of $page is 'contact'
     $this->contact();


    //I can't use switch() or if()
}
function gallery(){
    //anything
}
function contact(){
    //anything
}


Messages In This Thread
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 02:09 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 02:23 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 02:29 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 02:35 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 02:43 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 03:03 AM
How to use a variable in: $this->index(); ? - by El Forum - 04-15-2010, 03:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB