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