Welcome Guest, Not a member yet? Register   Sign In
Global Variable?
#1

Hello, 
i'm new here and i find it is hard to find an answer at google due to my lacks of grammar or i don't even know what i'm gonna search. I've been thinking this over and over and also with practices but i got nothing. so, i want to ask everybody in this forum about this "global variable or not" thing.

i have a controller, i called it A_Controller and it is look like this:
PHP Code:
class A_Controller extends CI_Controller {

  var 
$global 0;

  public function 
__construct(){
    
parent::__construct();
  }

  public function 
setGlobal($value){
    
$this->global $value;
  }

  public function 
index(){
    echo 
$this->global;
  }



what i want to approach is, when i access /A_Controller/setGlobal/1000 the global variable is set. and i want to see its value at /A_Controller/index. but, i always got the global is 0.
Reply


Messages In This Thread
Global Variable? - by Hasan Al-Haddad - 09-23-2018, 04:57 PM
RE: Global Variable? - by salain - 09-23-2018, 10:11 PM
RE: Global Variable? - by InsiteFX - 09-24-2018, 05:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB