PHP Class yii\rest\CreateAction

For more details and usage information on CreateAction, see the guide article on rest controllers.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Action
Show file Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$scenario the scenario to be assigned to the new model before it is validated and saved.
$viewAction the name of the view action. This property is need to create the URL when the model is successfully created.

Public Methods

Method Description
run ( ) : yii\db\ActiveRecordInterface Creates a new model.

Method Details

run() public method

Creates a new model.
public run ( ) : yii\db\ActiveRecordInterface
return yii\db\ActiveRecordInterface the model newly created

Property Details

$scenario public property

the scenario to be assigned to the new model before it is validated and saved.
public $scenario

$viewAction public property

the name of the view action. This property is need to create the URL when the model is successfully created.
public $viewAction