title: Setting default values on create and update in yii
body: <p>I am trying to update some fields in yii 1.1 using the following rules, but it is not working.</p>
  
  <pre><code>public function rules()
  {
      return [
         ['CreatedOn','default','value'=&gt;time(),'isEmpty'=&gt;true,'on'=&gt;'insert'],
         ['CreatedBy','default','value'=&gt;\Yii::$app-&gt;user-&gt;identity-&gt;id,'isEmpty'=&gt;true,'on'=&gt;'insert'],
         ['ModifiedOn','default','value'=&gt;time(),'isEmpty'=&gt;true,'on'=&gt;'update'],
         ['ModifiedBy','default','value'=&gt;\Yii::$app-&gt;user-&gt;identity-&gt;id,'isEmpty'=&gt;true,'on'=&gt;'update'],
      ];
  }
  </code></pre>
  
  <p>I am looking to update <code>CreatedBy</code> and <code>CreatedOn</code> when inserting, and <code>ModifiedBy</code> and <code>ModifiedOn</code> when updating.</p>