title: Accessing controller's global variable in ajax returns NULL
body: <p>Hi guys I have a controller which proceses data in its index() then
  assign it on a global variable. </p>
  
  <p>I want this global variable to be accessed by ajax when the pages successfully loaded.</p>
  
  <p>Here is what I've done in my index():</p>
  
  <pre><code>class Search extends Ss_controller {
  
   public static $q;
  
      public function index(){
  
          $k = $this-&gt;input-&gt;get(NULL, TRUE);
  
          $data['title'] = "Search";
          $data['page_content'] = "search_results_view.php";
          $data['logout'] = "/./ssmis/home/logout";
          $data['active_nav'] = 'Search';
          $data['k'] = $k['k'];
  
          self::$q = array('123','456');
          ...
  </code></pre>
  
  <p>and i have this method which will be function to be called in my ajax:</p>
  
  <pre><code> public function q(){
  
          var_dump(self::$q );
  
          if(self::$q ){
              $response['error'] = false;
              $response['has_data'] = true;
              $response['message'] = 'Success';
              $response['data'] = $this-&gt;q;
  
              $this-&gt;echo_response($response,200,'OK!');
          } else {
              $response['error'] = true;
              $response['message'] = 'No results returned';
  
  
              $this-&gt;echo_response($response,200,'Not OK!');
          }
      }
  </code></pre>
  
  <p>The problem is  var_dump(self::$q ); returns NULL.</p>
  
  <p>How can get the value of $q i assigned in the index() of my controller?</p>
  
  <p>Thanks!</p>