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

[eluser]mddd[/eluser]
Didn't I just answer that question?
Code:
function index()
{
   $page = $this->uri->segment(1);
   call_user_func(array($this, $page));
}
function gallery() ...
function contact() ...

Also: it looks to me like you are building functionality that CodeIgniter already has.
Why do you always go to this index method? CodeIgniter is smart about routing stuff directly to the correct controller/method.
You don't have to do that yourself.


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