title: Passing param to function in Yii
body: <p>I have set this in my main.php file:</p>
  
  <pre><code>'params'=&gt;array(
     'TOTAL_ACCOUNT_NUMBER'=&gt;'500100'
  )
  </code></pre>
  
  <p>I can successfully access the data using Yii::app()->params['TOTAL_ACCOUNT_NUMBER']</p>
  
  <p>I would like to pass this as a default to a method like so:</p>
  
  <pre><code>public function myMethod($acctNum=Yii::app()-&gt;params['TOTAL_ACCOUNT_NUMBER']) {
    ...
  }
  </code></pre>
  
  <p>This produces the syntax error: unexpected '('.  </p>
  
  <p>I can probably create a workaround with something like:</p>
  
  <pre><code>public function myMethod($acctNum=null) {
     $acctNum = !isset($acctNum) ? Yii::app()-&gt;params['TOTAL_ACCOUNT_NUMBER'] : $acctNum;
  }
  </code></pre>
  
  <p>But is there an easier way to format the original method to just avoid the syntax error?</p>
  
  <p>Thanks</p>