AR Child Model Types and Form Submit

I have a class Content extends CActiveRecord.

Then I have Page extends Content.

$page = new Page;

I send $page to a form view.

Now when I submit that form,

The controller code has if(iiset($_POST['Page'])) {…

However, $_POST['Page'] does not exist.    What exists is $_POST['Content'].

It looks like the activeR stuff sends the Parent Type and not the Child Type I originally declared.

How do I approach this so that the proper Child type is submitted to the Controller?

I don't think that's possible. Could you please double check?

The name of input fields is determined based on CHtml::resolveName() using a get_class($model) call.

Thanks Qiang,

I didn't have this method in my Page class.

public static function model($className=__CLASS__)


	return parent::model($className);


So it was referring to the Content class one instead.

Replace CLASS by 'Page' or when you call Page::mode(), you should call like this: Page::mode('Page').

What will cause problem is the derived class use a very common name, Page. I think the naming convention should be: ContentModel (for generated AR class) and Content extends ContentModel.