title: Fatal error: Call to a member function isAttributeRequired()
body: <p>I am having the following form</p>
  
  <pre><code>&lt;?php $form = $this-&gt;beginWidget('CActiveForm', array(
      'id'=&gt;'change-password',
      'enableAjaxValidation'=&gt;true,
      'enableClientValidation'=&gt;true,
      'focus'=&gt;array($model,'old-password')
      ));
  ?&gt;
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'oldPassword'); ?&gt;
      &lt;?php echo $form-&gt;passwordField($model,'oldPassword'); ?&gt;
      &lt;?php echo $form-&gt;error($model,'oldPassword'); ?&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;?php echo CHtml::submitButton('Submit');
  ?&gt;
  &lt;/div&gt;
  &lt;?php $this-&gt;endWidget(); ?&gt;
  </code></pre>
  
  <p>The above form throws an error as </p>
  
  <pre><code>Fatal error: Call to a member function isAttributeRequired() on a non-object in /framework/web/helpers/CHtml.php on line 1414
  </code></pre>
  
  <p>I am new you yii framework so i am unable to guess where the error is. can anyone help</p>
  
  <p><strong>Edit 1</strong></p>
  
  <pre><code>public static function activeLabelEx($model,$attribute,$htmlOptions=array())
      {
          $realAttribute=$attribute;
          self::resolveName($model,$attribute); // strip off square brackets if any
          $htmlOptions['required']=$model-&gt;isAttributeRequired($attribute);
          return self::activeLabel($model,$realAttribute,$htmlOptions);
      }
  </code></pre>
  
  <p><strong>Edit-2</strong></p>
  
  <p>If remove <code>&lt;?php echo $form-&gt;labelEx($model,'oldPassword'); ?&gt;</code> am getting error as</p>
  
  <pre><code>Fatal error: Call to a member function getValidators() on a non-object in CHtml.php on line 2236
  </code></pre>