Autogenerated Form

Hi All,

I have an ActiveRecord model which I would like to auto generate a form for.

I looked at CForm, but the constructor requires the first parameter explicitly state all the fields and their specifications.

Is there a way to not have to specify such things?

Can it infer from the ActiveRecord item what the field type is (ie - textarea, text, checkbox, etc)? Ideally this would also automatically figure out validation requirements (ie - null fields, and lengths).

Perhaps I am looking in the wont place for such a thing?

Basically I want something like this:

public function actionShowrow()

{

$model = Row::model();


$form = new FormFromModel($model);


if($form->submitted('login') && $form->validate())


    $this->redirect(array('site/index'));


else


    $this->render('login', array('form'=>$form));

}