HI, my question is or seems a little confused!
So, I want to call the create action of another controller, how do it?
Controller A
public function actionCreate()
{
$model = new Post();
$model->save();
}
But, I want:
public function actionCreate()
{
$model = new Post();
// call another model
$category = new Category();
$category->id_post = $model->category_id_post;
// save record in another model
$category->save();
// save record this model
$model->save();
}
- Read comments in code to understand
Thanks