Welcome Guest, Not a member yet? Register   Sign In
Setting a global variable in a controller?
#6

[eluser]Hannes Nevalainen[/eluser]
You can do this to:
Code:
//Constructor
function Admin(){
  parent::Controller();
  
  //Variables defined here will be passed to all your views!
  $this->load->vars(array(
    'ID'
  ));
}

EDIT:
Corrected the comment ('views' instead of 'controllers')


Messages In This Thread
Setting a global variable in a controller? - by El Forum - 08-07-2008, 11:42 AM
Setting a global variable in a controller? - by El Forum - 08-07-2008, 01:28 PM
Setting a global variable in a controller? - by El Forum - 08-07-2008, 01:29 PM
Setting a global variable in a controller? - by El Forum - 08-07-2008, 02:02 PM
Setting a global variable in a controller? - by El Forum - 08-07-2008, 02:06 PM
Setting a global variable in a controller? - by El Forum - 08-07-2008, 02:52 PM
Setting a global variable in a controller? - by El Forum - 08-08-2008, 12:15 AM
Setting a global variable in a controller? - by El Forum - 08-08-2008, 12:33 AM
Setting a global variable in a controller? - by El Forum - 08-08-2008, 01:03 AM
Setting a global variable in a controller? - by El Forum - 08-08-2008, 01:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB