title: IF condition inside an array
body: <p>In trying to use an <code>if</code> condition inside an <code>array</code>, but its not working. How can I fix that?</p>
  
  <p>Code:</p>
  
  <pre><code>public function behaviors()
  {
      return array(
          'withRelated'=&gt;array(
              'class'=&gt;'ext.wr.WithRelatedBehavior',
          ),
          Yii::app()-&gt;controller-&gt;id != 'apiv1' ?
          'datetimeI18NBehavior'=&gt;array(
              'class' =&gt; 'ext.DateTimeI18NBehavior',
          ), : false,
      );
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Parse error: syntax error, unexpected '=&gt;' (T_DOUBLE_ARROW) in .../models/Users.php on line 77
  </code></pre>