Answer the question
In order to leave comments, you need to log in
Is it possible to manually set the values of the fields of the created model using yii\rest\CreateAction?
Does yii\rest\CreateAction have a built-in way to prepare the created model? For example, so that I can manually set the ID of the author of the post being created (ID of the authorized user). You can of course use beforeAction() in ActiveRecord, or override actionCreate() in the controller, but maybe there is still a solution that works by analogy with findModel for view, update, delete and prepareDataProvider for index?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question