title: CForm and its behaviors do not have a method or closure named "beginWidget"
body: <p>I am quite new in using Yii Fraework and I am trying to implement a custom form with the skeletron from the contact form demo withon the blog demo from Yii Framework. I did almost exactly the same view,, controller and model as the respective form, only that I get the following 500 error:</p>
  
  <pre><code>Error 500 
  CForm and its behaviors do not have a method or closure named "beginWidget".
  </code></pre>
  
  <p>Here are the : Controller:</p>
  
  <pre><code>&lt;?php
      class CustomController extends Controller {
  
          public function actionSubmit()
          {
              $model = new CustomForm;
              $form = new CForm('application.views.custom._form', $model);
              $this-&gt;pageTitle = "ffffffffffff";//['title'] = "Authentication";
              if($form-&gt;submitted('submit') &amp;&amp; $form-&gt;validate())
                  $this-&gt;redirect(array('blog/index'));
              else
                  $this-&gt;render('_form', array('form'=&gt;$form));
          }
  
          public function getGenders()
          {
              return array(
                  0 =&gt; 'Male',
                  1 =&gt; 'Female');
          }
      }
  ?&gt;
  </code></pre>
  
  <p>The Model:</p>
  
  <pre><code>&lt;?php
  
      class CustomForm extends CFormModel {
          public $firstName;
          public $LastName;
          public $phone;
          public $address;
          public $gender;
          public $email;
  
          public function rules()
          {
              return array(
                      array('firstName, lastName, gender', 'required'),
                      array('email', 'email')
                  );
          }
      }
  ?&gt;
  </code></pre>
  
  <p>The view:</p>
  
  <pre><code>&lt;?php
  $this-&gt;pageTitle=Yii::app()-&gt;name . ' - Custom Form';
  $this-&gt;breadcrumbs=array(
      'Custom Form',
  );
  ?&gt;
  
  &lt;h1&gt;Custom Form&lt;/h1&gt;
  
  &lt;?php if(Yii::app()-&gt;user-&gt;hasFlash('custom')): ?&gt;
  
  &lt;div class="flash-success"&gt;
      &lt;?php echo Yii::app()-&gt;user-&gt;getFlash('custom'); ?&gt;
  &lt;/div&gt;
  
  &lt;?php else: ?&gt;
  
  &lt;p&gt;
  If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
  &lt;/p&gt;
  
  &lt;div class="form"&gt;
  
  &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
      'id'=&gt;'custom-form',
  )); ?&gt;
  
      &lt;p class="note"&gt;Fields with &lt;span class="required"&gt;*&lt;/span&gt; are required.&lt;/p&gt;
  
      &lt;?php echo $form-&gt;errorSummary($model); ?&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'firstName'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'firstName'); ?&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'lastName'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'lastName'); ?&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'email'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'email'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'phone'); ?&gt;
          &lt;?php echo $form-&gt;textField($model,'phone',array('size'=&gt;60,'maxlength'=&gt;128)); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'gender'); ?&gt;
          &lt;?php echo $form-&gt;radioButton($model,'gender',array('value'=&gt;'Male')) . 'Male'; ?&gt;
          &lt;?php echo $form-&gt;radioButton($model,'gender',array('value'=&gt;'Female')) . 'Female'; ?&gt;
          &lt;?php echo $form-&gt;error($model,'gender'); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
          &lt;?php echo $form-&gt;labelEx($model,'address'); ?&gt;
          &lt;?php echo $form-&gt;textArea($model,'address',array('rows'=&gt;6, 'cols'=&gt;50)); ?&gt;
      &lt;/div&gt;
  
      &lt;div class="row submit"&gt;
          &lt;?php echo CHtml::submitButton('Submit'); ?&gt;
      &lt;/div&gt;
  
  &lt;?php $this-&gt;endWidget(); ?&gt;
  
  &lt;/div&gt;&lt;!-- form --&gt;
  
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Any ideas why am I getting this error? What am I doing wrong?</p>
  
  <p>Thanks!</p>