I have three tables like tbl_A tbl_B tbl_C. tbl_B and tbl_C are relationed with tbl_A through A_ID. I create model through tal_A in gii and confirgure the function relations(). I use the CActiveForm to generate the view to end-users.
In this view. not only does it include field in tbl_A, but it also it include tbl_B and tbl_C.
my question is how to handle the field which not in tbl_A. To field in tbl_A. I use below code to render it.
<?php echo $form->textField($model,‘column name in tbl_A’,array(‘maxlength’=>50));?>
but I don’t know how to render field in tbl_B and tbl_C. or I should use the CForm. if it is. How could I do.
That’s one form, with two different models – $_POST[‘MODEL_NAME’] not $_POST[‘FORM_NAME’] (unless you have a CFormModel, but that’s a different story).