Active Record and Forms?

As I am going through my evaluation of this framework, I have a question about active records and forms. Now I am just trying to build a simple blog and I have an active record object called BlogPost. Now it seems like you have 2 different types of models, Active Record and Form. I assume that it would make more sense to use the Form model when I need to process a form, correct? Now for my main question, is it possible to somehow automatically link a form model to an active record model so I could create the form model, populate its data, validate it, and then if it passes validation, save that form model to a database table that is linked my active record model?

something like this:




$model = new BlogPostForm();

if(isset($_POST['BlogPostForm']))

{

    $model->attributes=$_POST['BlogPostForm'];

    if($model->validate())

    {

        BlogPost::saveFromFormModel($model);

    }

}



You can either use a FormModel or an ActiveRecord for your form. Former is used in situations where there’s no DB involved (see the contact form from the base webapp). So in your case: Simply use your ActiveRecord as model for the form.