не могу понять для нужен parent::__construct
class ProductController extends Controller
{
private $service;
public function __construct($id, $module, ProductManageService $service, $config = [])
{
$this->service = $service;
parent::__construct($id, $module, $config); //кому обращается parent
}
...
public function actionCreate()
{
$form = new ProductCreateForm();
if ($form->load(Yii::$app->request->post()) && $form->validate()) {
$id = $this->service->create($form);
return $this->redirect(['view', 'id' => $id]);
}
return $this->render('create', [
'model' => $form,
]);
}
}