title: Yii - how to access the base URL in main config
body: <p>I am working on a Yii application. I am trying to set some paths in my main config params like this:</p>
  
  <pre><code>// application-level parameters that can be accessed
  // using Yii::app()-&gt;params['paramName']
  'params'=&gt;array(
         'paths' =&gt; array(
              'imageTemp'=&gt; Yii::getPathOfAlias('webroot').'/files/temp-',
              'image'=&gt; Yii::getPathOfAlias('webroot').'/files/',
              ...
          ),
  
          'urls' =&gt; array(
              'imageTemp'=&gt; Yii::app()-&gt;getBaseUrl().'/files/temp-',
              'image'=&gt; Yii::app()-&gt;getBaseUrl().'/files/',
              ...
          ),
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <pre><code>Fatal error: Call to a member function getBaseUrl() on a non-object in ..blahblah../base/CApplication.php on line 553
  </code></pre>
  
  <p>I think I cannot use Yii::app() in config file since the app is not initialized yet here, or something like this. So, how can I replace <code>Yii::app()-&gt;getBaseUrl()</code> in the config file and get the same results?</p>