title: YII main.php access database table values
body: <p>how to access the database table values in main.php</p>
  
  <pre><code>return array(
                  'onBeginRequest'=&gt;array('dbVar'),
  );
  </code></pre>
  
  <p>it return values , </p>
  
  <p>in dbVar.php i have the functions like this,</p>
  
  <pre><code>class dbVar{
          public static function getList(){
              $dependency = new CDbCacheDependency('SELECT * FROM table WHERE id=1');
              $data = Yii::app()-&gt;db-&gt;cache(Yii::app()-&gt;params['cacheInterval'], $dependency)-&gt;createCommand('SELECT * FROM table WHERE id=1')-&gt;queryRow();
              echo "&lt;pre&gt;";
              print_r($data);
              exit;       
          }
      }
  </code></pre>
  
  <p>how to access the return values in the main.php, </p>