title: Codeigniter global variables in a core controller
body: <p>I am using <strong>$langs</strong> Variable in my Core Controller.
  How to use Global Variables in Codeigniter? i'm very newbie on CI</p>
  
  <p>My Controller Code is :</p>
  
  <pre><code>class MY_Controller extends CI_Controller{
    //global items
    var $langs;
    // construct
    public function __construct(){
      parent::__construct();
      global $title;
      $langs = array(
        'en' =&gt;'English',
        'zh'  =&gt;  '繁體中文',
        'zh_CN' =&gt;  '簡體中文',
        'fr'  =&gt;  'français',
        'de'  =&gt;  'Deutsch',
        'ja'  =&gt;  '日本語',
        'es'  =&gt;  'Español',
        'pt'  =&gt;  'Português',
        'ru'  =&gt;  'Русский',
        'tr'  =&gt;  'Türkçe',
        'kr'  =&gt;  '한국어'
      );
    }
  </code></pre>
  
  <p>My View Code is :</p>
  
  <pre><code>&lt;?
  //display
  var_dump($langs);
  ?&gt;
  </code></pre>